<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/linux/linux-3.13/include/linux/mm.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/linux/linux-3.13/include/linux/mm.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="Maybe">       1:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_X0xJTlVYX01NX0hfMA__"><span class="b">_LINUX_MM_H</span></a>
<a name="2" /><span class="Maybe">       2:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X0xJTlVYX01NX0hfMA__"><span class="b">_LINUX_MM_H</span></a>
<a name="3" /><span class="Maybe">       3:</span> 
<a name="4" /><span class="Maybe">       4:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">errno</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="5" /><span class="Maybe">       5:</span> 
<a name="6" /><span class="Maybe">       6:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_X19LRVJORUxfX18w"><span class="b">__KERNEL__</span></a>
<a name="7" /><span class="Maybe">       7:</span> 
<a name="8" /><span class="Maybe">       8:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">gfp</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="9" /><span class="Maybe">       9:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">bug</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="10" /><span class="Maybe">      10:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">list</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="11" /><span class="Maybe">      11:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">mmzone</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="12" /><span class="Maybe">      12:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">rbtree</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="13" /><span class="Maybe">      13:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">atomic</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="14" /><span class="Maybe">      14:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">debug_locks</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="15" /><span class="Maybe">      15:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">mm_types</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="16" /><span class="Maybe">      16:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">range</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="17" /><span class="Maybe">      17:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">pfn</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="18" /><span class="Maybe">      18:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">bit_spinlock</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="19" /><span class="Maybe">      19:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">shrinker</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="20" /><span class="Maybe">      20:</span> 
<a name="21" /><span class="Maybe">      21:</span> <span class="m">struct</span> <span class="b">mempolicy</span><span class="f">;</span>
<a name="22" /><span class="Maybe">      22:</span> <span class="m">struct</span> <span class="b">anon_vma</span><span class="f">;</span>
<a name="23" /><span class="Maybe">      23:</span> <span class="m">struct</span> <span class="b">anon_vma_chain</span><span class="f">;</span>
<a name="24" /><span class="Maybe">      24:</span> <span class="m">struct</span> <span class="b">file_ra_state</span><span class="f">;</span>
<a name="25" /><span class="Maybe">      25:</span> <span class="m">struct</span> <span class="b">user_struct</span><span class="f">;</span>
<a name="26" /><span class="Maybe">      26:</span> <span class="m">struct</span> <span class="b">writeback_control</span><span class="f">;</span>
<a name="27" /><span class="Maybe">      27:</span> 
<a name="28" /><span class="False">      28:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX05FRURfTVVMVElQTEVfTk9ERVNfMA__"><span class="b">CONFIG_NEED_MULTIPLE_NODES</span></a>    <span class="k">/* Don&apos;t use mapnrs, do it properly */</span>
<a name="29" /><span class="False">      29:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">max_mapnr</span><span class="f">;</span>
<a name="30" /><span class="False">      30:</span> 
<a name="31" /><span class="False">      31:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_max_mapnr</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">limit</span><span class="f">)</span>
<a name="32" /><span class="False">      32:</span> <span class="f">{</span>
<a name="33" /><span class="False">      33:</span>     <span class="b">max_mapnr</span> <span class="f">=</span> <span class="b">limit</span><span class="f">;</span>
<a name="34" /><span class="False">      34:</span> <span class="f">}</span>
<a name="35" /><span class="Maybe">      35:</span> <span class="f">#</span><span class="n">else</span>
<a name="36" /><span class="Maybe">      36:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_max_mapnr</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">limit</span><span class="f">)</span> <span class="f">{</span> <span class="f">}</span>
<a name="37" /><span class="Maybe">      37:</span> <span class="f">#</span><span class="n">endif</span>
<a name="38" /><span class="Maybe">      38:</span> 
<a name="39" /><span class="Maybe">      39:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">totalram_pages</span><span class="f">;</span>
<a name="40" /><span class="Maybe">      40:</span> <span class="m">extern</span> <span class="m">void</span> <span class="f">*</span> <span class="b">high_memory</span><span class="f">;</span>
<a name="41" /><span class="Maybe">      41:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">page_cluster</span><span class="f">;</span>
<a name="42" /><span class="Maybe">      42:</span> 
<a name="43" /><span class="Maybe">      43:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX1NZU0NUTF8w"><span class="b">CONFIG_SYSCTL</span></a>
<a name="44" /><span class="Maybe">      44:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">sysctl_legacy_va_layout</span><span class="f">;</span>
<a name="45" /><span class="False">      45:</span> <span class="f">#</span><span class="n">else</span>
<a name="46" /><span class="False">      46:</span> <span class="f">#</span><span class="n">define</span> <span class="b">sysctl_legacy_va_layout</span> <span class="c">0</span>
<a name="47" /><span class="Maybe">      47:</span> <span class="f">#</span><span class="n">endif</span>
<a name="48" /><span class="Maybe">      48:</span> 
<a name="49" /><span class="Maybe">      49:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="m">asm</span><span class="f">/</span><span class="b">page</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="50" /><span class="Maybe">      50:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="m">asm</span><span class="f">/</span><span class="b">pgtable</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="51" /><span class="Maybe">      51:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="m">asm</span><span class="f">/</span><span class="b">processor</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="52" /><span class="Maybe">      52:</span> 
<a name="53" /><span class="False">      53:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_X19wYV9zeW1ib2xfMA__"><span class="b">__pa_symbol</span></a>
<a name="54" /><span class="False">      54:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X19wYV9zeW1ib2xfMA__"><span class="b">__pa_symbol</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span>  <a href="cpu.c_macros_ref.html#_X19wYV8w"><span class="b">__pa</span></a><span class="f">(</span><a href="cpu.c_macros_ref.html#_UkVMT0NfSElERV8w"><span class="b">RELOC_HIDE</span></a><span class="f">(</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="f">(</span><span class="b">x</span><span class="f">)</span><span class="f">,</span> <span class="c">0</span><span class="f">)</span><span class="f">)</span>
<a name="55" /><span class="Maybe">      55:</span> <span class="f">#</span><span class="n">endif</span>
<a name="56" /><span class="Maybe">      56:</span> 
<a name="57" /><span class="Maybe">      57:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">sysctl_user_reserve_kbytes</span><span class="f">;</span>
<a name="58" /><span class="Maybe">      58:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">sysctl_admin_reserve_kbytes</span><span class="f">;</span>
<a name="59" /><span class="Maybe">      59:</span> 
<a name="60" /><span class="Maybe">      60:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_bnRoX3BhZ2VfMA__"><span class="b">nth_page</span></a><span class="f">(</span><span class="b">page</span><span class="f">,</span><span class="b">n</span><span class="f">)</span> <a href="cpu.c_macros_ref.html#_cGZuX3RvX3BhZ2VfMA__"><span class="b">pfn_to_page</span></a><span class="f">(</span><a href="cpu.c_macros_ref.html#_cGFnZV90b19wZm5fMA__"><span class="b">page_to_pfn</span></a><span class="f">(</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span> <span class="f">+</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">)</span>
<a name="61" /><span class="Maybe">      61:</span> 
<a name="62" /><span class="Maybe">      62:</span> <span class="k">/* to align the pointer to the (next) page boundary */</span>
<a name="63" /><span class="Maybe">      63:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_UEFHRV9BTElHTl8w"><span class="b">PAGE_ALIGN</span></a><span class="f">(</span><span class="b">addr</span><span class="f">)</span> <a href="cpu.c_macros_noref.html#_QUxJR05fMA__"><span class="b">ALIGN</span></a><span class="f">(</span><span class="b">addr</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_UEFHRV9TSVpFXzA_"><span class="b">PAGE_SIZE</span></a><span class="f">)</span>
<a name="64" /><span class="Maybe">      64:</span> 
<a name="65" /><span class="Maybe">      65:</span> <span class="k">/* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */</span>
<a name="66" /><span class="Maybe">      66:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_UEFHRV9BTElHTkVEXzA_"><span class="b">PAGE_ALIGNED</span></a><span class="f">(</span><span class="b">addr</span><span class="f">)</span>    <a href="cpu.c_macros_noref.html#_SVNfQUxJR05FRF8w"><span class="b">IS_ALIGNED</span></a><span class="f">(</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="b">addr</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_UEFHRV9TSVpFXzA_"><span class="b">PAGE_SIZE</span></a><span class="f">)</span>
<a name="67" /><span class="Maybe">      67:</span> 
<a name="68" /><span class="Maybe">      68:</span> <span class="k">/*</span>
<a name="69" /><span class="Maybe">      69:</span> <span class="k"> * Linux kernel virtual memory manager primitives.</span>
<a name="70" /><span class="Maybe">      70:</span> <span class="k"> * The idea being to have a &quot;virtual&quot; mm in the same way</span>
<a name="71" /><span class="Maybe">      71:</span> <span class="k"> * we have a virtual fs - giving a cleaner interface to the</span>
<a name="72" /><span class="Maybe">      72:</span> <span class="k"> * mm details, and allowing different kinds of memory mappings</span>
<a name="73" /><span class="Maybe">      73:</span> <span class="k"> * (from shared memory to executable loading to arbitrary</span>
<a name="74" /><span class="Maybe">      74:</span> <span class="k"> * mmap() functions).</span>
<a name="75" /><span class="Maybe">      75:</span> <span class="k"> */</span>
<a name="76" /><span class="Maybe">      76:</span> 
<a name="77" /><span class="Maybe">      77:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">vm_area_cachep</span><span class="f">;</span>
<a name="78" /><span class="Maybe">      78:</span> 
<a name="79" /><span class="False">      79:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a>
<a name="80" /><span class="False">      80:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">rb_root</span> <span class="b">nommu_region_tree</span><span class="f">;</span>
<a name="81" /><span class="False">      81:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">rw_semaphore</span> <span class="b">nommu_region_sem</span><span class="f">;</span>
<a name="82" /><span class="False">      82:</span> 
<a name="83" /><span class="False">      83:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">kobjsize</span><span class="f">(</span><span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">objp</span><span class="f">)</span><span class="f">;</span>
<a name="84" /><span class="Maybe">      84:</span> <span class="f">#</span><span class="n">endif</span>
<a name="85" /><span class="Maybe">      85:</span> 
<a name="86" /><span class="Maybe">      86:</span> <span class="k">/*</span>
<a name="87" /><span class="Maybe">      87:</span> <span class="k"> * vm_flags in vm_area_struct, see mm_types.h.</span>
<a name="88" /><span class="Maybe">      88:</span> <span class="k"> */</span>
<a name="89" /><span class="Maybe">      89:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Vk1fTk9ORV8w"><span class="b">VM_NONE</span></a>        <span class="c">0x00000000</span>
<a name="90" /><span class="Maybe">      90:</span> 
<a name="91" /><span class="Maybe">      91:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fUkVBRF8w"><span class="b">VM_READ</span></a>        <span class="c">0x00000001</span>    <span class="k">/* currently active flags */</span>
<a name="92" /><span class="Maybe">      92:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Vk1fV1JJVEVfMA__"><span class="b">VM_WRITE</span></a>    <span class="c">0x00000002</span>
<a name="93" /><span class="Maybe">      93:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRVhFQ18w"><span class="b">VM_EXEC</span></a>        <span class="c">0x00000004</span>
<a name="94" /><span class="Maybe">      94:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fU0hBUkVEXzA_"><span class="b">VM_SHARED</span></a>    <span class="c">0x00000008</span>
<a name="95" /><span class="Maybe">      95:</span> 
<a name="96" /><span class="Maybe">      96:</span> <span class="k">/* mprotect() hardcodes VM_MAYREAD &gt;&gt; 4 == VM_READ, and so for r/w/x bits. */</span>
<a name="97" /><span class="Maybe">      97:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTUFZUkVBRF8w"><span class="b">VM_MAYREAD</span></a>    <span class="c">0x00000010</span>    <span class="k">/* limits for mprotect() etc */</span>
<a name="98" /><span class="Maybe">      98:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTUFZV1JJVEVfMA__"><span class="b">VM_MAYWRITE</span></a>    <span class="c">0x00000020</span>
<a name="99" /><span class="Maybe">      99:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTUFZRVhFQ18w"><span class="b">VM_MAYEXEC</span></a>    <span class="c">0x00000040</span>
<a name="100" /><span class="Maybe">     100:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTUFZU0hBUkVfMA__"><span class="b">VM_MAYSHARE</span></a>    <span class="c">0x00000080</span>
<a name="101" /><span class="Maybe">     101:</span> 
<a name="102" /><span class="Maybe">     102:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NET1dOXzA_"><span class="b">VM_GROWSDOWN</span></a>    <span class="c">0x00000100</span>    <span class="k">/* general info on the segment */</span>
<a name="103" /><span class="Maybe">     103:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fUEZOTUFQXzA_"><span class="b">VM_PFNMAP</span></a>    <span class="c">0x00000400</span>    <span class="k">/* Page-ranges managed without &quot;struct page&quot;, just pure PFN */</span>
<a name="104" /><span class="Maybe">     104:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fREVOWVdSSVRFXzA_"><span class="b">VM_DENYWRITE</span></a>    <span class="c">0x00000800</span>    <span class="k">/* ETXTBSY on write attempts.. */</span>
<a name="105" /><span class="Maybe">     105:</span> 
<a name="106" /><span class="Maybe">     106:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTE9DS0VEXzA_"><span class="b">VM_LOCKED</span></a>    <span class="c">0x00002000</span>
<a name="107" /><span class="Maybe">     107:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fSU9fMA__"><span class="b">VM_IO</span></a>           <span class="c">0x00004000</span>    <span class="k">/* Memory mapped I/O or similar */</span>
<a name="108" /><span class="Maybe">     108:</span> 
<a name="109" /><span class="Maybe">     109:</span>                     <span class="k">/* Used by sys_madvise() */</span>
<a name="110" /><span class="Maybe">     110:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fU0VRX1JFQURfMA__"><span class="b">VM_SEQ_READ</span></a>    <span class="c">0x00008000</span>    <span class="k">/* App will access data sequentially */</span>
<a name="111" /><span class="Maybe">     111:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fUkFORF9SRUFEXzA_"><span class="b">VM_RAND_READ</span></a>    <span class="c">0x00010000</span>    <span class="k">/* App will not benefit from clustered reads */</span>
<a name="112" /><span class="Maybe">     112:</span> 
<a name="113" /><span class="Maybe">     113:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRE9OVENPUFlfMA__"><span class="b">VM_DONTCOPY</span></a>    <span class="c">0x00020000</span>      <span class="k">/* Do not copy this vma on fork */</span>
<a name="114" /><span class="Maybe">     114:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRE9OVEVYUEFORF8w"><span class="b">VM_DONTEXPAND</span></a>    <span class="c">0x00040000</span>    <span class="k">/* Cannot expand with mremap() */</span>
<a name="115" /><span class="Maybe">     115:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fQUNDT1VOVF8w"><span class="b">VM_ACCOUNT</span></a>    <span class="c">0x00100000</span>    <span class="k">/* Is a VM accounted object */</span>
<a name="116" /><span class="Maybe">     116:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTk9SRVNFUlZFXzA_"><span class="b">VM_NORESERVE</span></a>    <span class="c">0x00200000</span>    <span class="k">/* should the VM suppress accounting */</span>
<a name="117" /><span class="Maybe">     117:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fSFVHRVRMQl8w"><span class="b">VM_HUGETLB</span></a>    <span class="c">0x00400000</span>    <span class="k">/* Huge TLB Page VM */</span>
<a name="118" /><span class="Maybe">     118:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTk9OTElORUFSXzA_"><span class="b">VM_NONLINEAR</span></a>    <span class="c">0x00800000</span>    <span class="k">/* Is non-linear (remap_file_pages) */</span>
<a name="119" /><span class="Maybe">     119:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fQVJDSF8xXzA_"><span class="b">VM_ARCH_1</span></a>    <span class="c">0x01000000</span>    <span class="k">/* Architecture-specific flag */</span>
<a name="120" /><span class="Maybe">     120:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRE9OVERVTVBfMA__"><span class="b">VM_DONTDUMP</span></a>    <span class="c">0x04000000</span>    <span class="k">/* Do not include in the core dump */</span>
<a name="121" /><span class="Maybe">     121:</span> 
<a name="122" /><span class="False">     122:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_MEM_SOFT_DIRTY</span>
<a name="123" /><span class="False">     123:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fU09GVERJUlRZXzA_"><span class="b">VM_SOFTDIRTY</span></a>    <span class="c">0x08000000</span>    <span class="k">/* Not soft dirty clean area */</span>
<a name="124" /><span class="Maybe">     124:</span> <span class="f">#</span><span class="n">else</span>
<a name="125" /><span class="Maybe">     125:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fU09GVERJUlRZXzA_"><span class="b">VM_SOFTDIRTY</span></a>    <span class="c">0</span>
<a name="126" /><span class="Maybe">     126:</span> <span class="f">#</span><span class="n">endif</span>
<a name="127" /><span class="Maybe">     127:</span> 
<a name="128" /><span class="Maybe">     128:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTUlYRURNQVBfMA__"><span class="b">VM_MIXEDMAP</span></a>    <span class="c">0x10000000</span>    <span class="k">/* Can contain &quot;struct page&quot; and pure PFN pages */</span>
<a name="129" /><span class="Maybe">     129:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fSFVHRVBBR0VfMA__"><span class="b">VM_HUGEPAGE</span></a>    <span class="c">0x20000000</span>    <span class="k">/* MADV_HUGEPAGE marked this vma */</span>
<a name="130" /><span class="Maybe">     130:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTk9IVUdFUEFHRV8w"><span class="b">VM_NOHUGEPAGE</span></a>    <span class="c">0x40000000</span>    <span class="k">/* MADV_NOHUGEPAGE marked this vma */</span>
<a name="131" /><span class="Maybe">     131:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTUVSR0VBQkxFXzA_"><span class="b">VM_MERGEABLE</span></a>    <span class="c">0x80000000</span>    <span class="k">/* KSM may merge identical pages */</span>
<a name="132" /><span class="Maybe">     132:</span> 
<a name="133" /><span class="Maybe">     133:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX1g4Nl8w"><span class="b">CONFIG_X86</span></a><span class="f">)</span>
<a name="134" /><span class="Maybe">     134:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fUEFUXzA_"><span class="b">VM_PAT</span></a>        <a href="cpu.c_macros_noref.html#_Vk1fQVJDSF8xXzA_"><span class="b">VM_ARCH_1</span></a>    <span class="k">/* PAT reserves whole VMA at once (x86) */</span>
<a name="135" /><span class="False">     135:</span> <span class="f">#</span><span class="n">elif</span> <span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_PPC</span><span class="f">)</span>
<a name="136" /><span class="False">     136:</span> <span class="f">#</span> <span class="n">define</span> <span class="b">VM_SAO</span>        <a href="cpu.c_macros_noref.html#_Vk1fQVJDSF8xXzA_"><span class="b">VM_ARCH_1</span></a>    <span class="k">/* Strong Access Ordering (powerpc) */</span>
<a name="137" /><span class="False">     137:</span> <span class="f">#</span><span class="n">elif</span> <span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_PARISC</span><span class="f">)</span>
<a name="138" /><span class="False">     138:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NVUF8w"><span class="b">VM_GROWSUP</span></a>    <a href="cpu.c_macros_noref.html#_Vk1fQVJDSF8xXzA_"><span class="b">VM_ARCH_1</span></a>
<a name="139" /><span class="False">     139:</span> <span class="f">#</span><span class="n">elif</span> <span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_METAG</span><span class="f">)</span>
<a name="140" /><span class="False">     140:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NVUF8w"><span class="b">VM_GROWSUP</span></a>    <a href="cpu.c_macros_noref.html#_Vk1fQVJDSF8xXzA_"><span class="b">VM_ARCH_1</span></a>
<a name="141" /><span class="False">     141:</span> <span class="f">#</span><span class="n">elif</span> <span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_IA64</span><span class="f">)</span>
<a name="142" /><span class="False">     142:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NVUF8w"><span class="b">VM_GROWSUP</span></a>    <a href="cpu.c_macros_noref.html#_Vk1fQVJDSF8xXzA_"><span class="b">VM_ARCH_1</span></a>
<a name="143" /><span class="False">     143:</span> <span class="f">#</span><span class="n">elif</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a><span class="f">)</span>
<a name="144" /><span class="False">     144:</span> <span class="f">#</span> <span class="n">define</span> <span class="b">VM_MAPPED_COPY</span>    <a href="cpu.c_macros_noref.html#_Vk1fQVJDSF8xXzA_"><span class="b">VM_ARCH_1</span></a>    <span class="k">/* T if mapped copy of data (nommu mmap) */</span>
<a name="145" /><span class="Maybe">     145:</span> <span class="f">#</span><span class="n">endif</span>
<a name="146" /><span class="Maybe">     146:</span> 
<a name="147" /><span class="Maybe">     147:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NVUF8w"><span class="b">VM_GROWSUP</span></a>
<a name="148" /><span class="Maybe">     148:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NVUF8w"><span class="b">VM_GROWSUP</span></a>    <a href="cpu.c_macros_ref.html#_Vk1fTk9ORV8w"><span class="b">VM_NONE</span></a>
<a name="149" /><span class="Maybe">     149:</span> <span class="f">#</span><span class="n">endif</span>
<a name="150" /><span class="Maybe">     150:</span> 
<a name="151" /><span class="Maybe">     151:</span> <span class="k">/* Bits set in the VMA until the stack is in its final location */</span>
<a name="152" /><span class="Maybe">     152:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fU1RBQ0tfSU5DT01QTEVURV9TRVRVUF8w"><span class="b">VM_STACK_INCOMPLETE_SETUP</span></a>    <span class="f">(</span><a href="cpu.c_macros_noref.html#_Vk1fUkFORF9SRUFEXzA_"><span class="b">VM_RAND_READ</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_Vk1fU0VRX1JFQURfMA__"><span class="b">VM_SEQ_READ</span></a><span class="f">)</span>
<a name="153" /><span class="Maybe">     153:</span> 
<a name="154" /><span class="Maybe">     154:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_Vk1fU1RBQ0tfREVGQVVMVF9GTEFHU18w"><span class="b">VM_STACK_DEFAULT_FLAGS</span></a>        <span class="k">/* arch can override this */</span>
<a name="155" /><span class="Maybe">     155:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Vk1fU1RBQ0tfREVGQVVMVF9GTEFHU18w"><span class="b">VM_STACK_DEFAULT_FLAGS</span></a> <a href="cpu.c_macros_noref.html#_Vk1fREFUQV9ERUZBVUxUX0ZMQUdTXzA_"><span class="b">VM_DATA_DEFAULT_FLAGS</span></a>
<a name="156" /><span class="Maybe">     156:</span> <span class="f">#</span><span class="n">endif</span>
<a name="157" /><span class="Maybe">     157:</span> 
<a name="158" /><span class="False">     158:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_STACK_GROWSUP</span>
<a name="159" /><span class="False">     159:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fU1RBQ0tfRkxBR1NfMA__"><span class="b">VM_STACK_FLAGS</span></a>    <span class="f">(</span><a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NVUF8w"><span class="b">VM_GROWSUP</span></a> <span class="f">|</span> <a href="cpu.c_macros_ref.html#_Vk1fU1RBQ0tfREVGQVVMVF9GTEFHU18w"><span class="b">VM_STACK_DEFAULT_FLAGS</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_Vk1fQUNDT1VOVF8w"><span class="b">VM_ACCOUNT</span></a><span class="f">)</span>
<a name="160" /><span class="Maybe">     160:</span> <span class="f">#</span><span class="n">else</span>
<a name="161" /><span class="Maybe">     161:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fU1RBQ0tfRkxBR1NfMA__"><span class="b">VM_STACK_FLAGS</span></a>    <span class="f">(</span><a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NET1dOXzA_"><span class="b">VM_GROWSDOWN</span></a> <span class="f">|</span> <a href="cpu.c_macros_ref.html#_Vk1fU1RBQ0tfREVGQVVMVF9GTEFHU18w"><span class="b">VM_STACK_DEFAULT_FLAGS</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_Vk1fQUNDT1VOVF8w"><span class="b">VM_ACCOUNT</span></a><span class="f">)</span>
<a name="162" /><span class="Maybe">     162:</span> <span class="f">#</span><span class="n">endif</span>
<a name="163" /><span class="Maybe">     163:</span> 
<a name="164" /><span class="Maybe">     164:</span> <span class="k">/*</span>
<a name="165" /><span class="Maybe">     165:</span> <span class="k"> * Special vmas that are non-mergable, non-mlock()able.</span>
<a name="166" /><span class="Maybe">     166:</span> <span class="k"> * Note: mm/huge_memory.c VM_NO_THP depends on this definition.</span>
<a name="167" /><span class="Maybe">     167:</span> <span class="k"> */</span>
<a name="168" /><span class="Maybe">     168:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fU1BFQ0lBTF8w"><span class="b">VM_SPECIAL</span></a> <span class="f">(</span><a href="cpu.c_macros_noref.html#_Vk1fSU9fMA__"><span class="b">VM_IO</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_Vk1fRE9OVEVYUEFORF8w"><span class="b">VM_DONTEXPAND</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_Vk1fUEZOTUFQXzA_"><span class="b">VM_PFNMAP</span></a><span class="f">)</span>
<a name="169" /><span class="Maybe">     169:</span> 
<a name="170" /><span class="Maybe">     170:</span> <span class="k">/*</span>
<a name="171" /><span class="Maybe">     171:</span> <span class="k"> * mapping from the currently active vm_flags protection bits (the</span>
<a name="172" /><span class="Maybe">     172:</span> <span class="k"> * low four bits) to a page protection mask..</span>
<a name="173" /><span class="Maybe">     173:</span> <span class="k"> */</span>
<a name="174" /><span class="Maybe">     174:</span> <span class="m">extern</span> <span class="b">pgprot_t</span> <span class="b">protection_map</span><span class="f">[</span><span class="c">16</span><span class="f">]</span><span class="f">;</span>
<a name="175" /><span class="Maybe">     175:</span> 
<a name="176" /><span class="Maybe">     176:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RkFVTFRfRkxBR19XUklURV8w"><span class="b">FAULT_FLAG_WRITE</span></a>    <span class="c">0x01</span>    <span class="k">/* Fault was a write access */</span>
<a name="177" /><span class="Maybe">     177:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RkFVTFRfRkxBR19OT05MSU5FQVJfMA__"><span class="b">FAULT_FLAG_NONLINEAR</span></a>    <span class="c">0x02</span>    <span class="k">/* Fault was via a nonlinear mapping */</span>
<a name="178" /><span class="Maybe">     178:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RkFVTFRfRkxBR19NS1dSSVRFXzA_"><span class="b">FAULT_FLAG_MKWRITE</span></a>    <span class="c">0x04</span>    <span class="k">/* Fault was mkwrite of existing pte */</span>
<a name="179" /><span class="Maybe">     179:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RkFVTFRfRkxBR19BTExPV19SRVRSWV8w"><span class="b">FAULT_FLAG_ALLOW_RETRY</span></a>    <span class="c">0x08</span>    <span class="k">/* Retry fault if blocking */</span>
<a name="180" /><span class="Maybe">     180:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RkFVTFRfRkxBR19SRVRSWV9OT1dBSVRfMA__"><span class="b">FAULT_FLAG_RETRY_NOWAIT</span></a>    <span class="c">0x10</span>    <span class="k">/* Don&apos;t drop mmap_sem and wait when retrying */</span>
<a name="181" /><span class="Maybe">     181:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RkFVTFRfRkxBR19LSUxMQUJMRV8w"><span class="b">FAULT_FLAG_KILLABLE</span></a>    <span class="c">0x20</span>    <span class="k">/* The fault task is in SIGKILL killable region */</span>
<a name="182" /><span class="Maybe">     182:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RkFVTFRfRkxBR19UUklFRF8w"><span class="b">FAULT_FLAG_TRIED</span></a>    <span class="c">0x40</span>    <span class="k">/* second try */</span>
<a name="183" /><span class="Maybe">     183:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_RkFVTFRfRkxBR19VU0VSXzA_"><span class="b">FAULT_FLAG_USER</span></a>        <span class="c">0x80</span>    <span class="k">/* The fault originated in userspace */</span>
<a name="184" /><span class="Maybe">     184:</span> 
<a name="185" /><span class="Maybe">     185:</span> <span class="k">/*</span>
<a name="186" /><span class="Maybe">     186:</span> <span class="k"> * vm_fault is filled by the the pagefault handler and passed to the vma&apos;s</span>
<a name="187" /><span class="Maybe">     187:</span> <span class="k"> * -&gt;fault function. The vma&apos;s -&gt;fault is responsible for returning a bitmask</span>
<a name="188" /><span class="Maybe">     188:</span> <span class="k"> * of VM_FAULT_xxx flags that give details about how the fault was handled.</span>
<a name="189" /><span class="Maybe">     189:</span> <span class="k"> *</span>
<a name="190" /><span class="Maybe">     190:</span> <span class="k"> * pgoff should be used in favour of virtual_address, if possible. If pgoff</span>
<a name="191" /><span class="Maybe">     191:</span> <span class="k"> * is used, one may implement -&gt;remap_pages to get nonlinear mapping support.</span>
<a name="192" /><span class="Maybe">     192:</span> <span class="k"> */</span>
<a name="193" /><span class="Maybe">     193:</span> <span class="m">struct</span> <span class="b">vm_fault</span> <span class="f">{</span>
<a name="194" /><span class="Maybe">     194:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">flags</span><span class="f">;</span>        <span class="k">/* FAULT_FLAG_xxx flags */</span>
<a name="195" /><span class="Maybe">     195:</span>     <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">pgoff</span><span class="f">;</span>            <span class="k">/* Logical page offset based on vma */</span>
<a name="196" /><span class="Maybe">     196:</span>     <span class="m">void</span> <a href="cpu.c_macros_ref.html#_X191c2VyXzA_"><span class="b">__user</span></a> <span class="f">*</span><span class="b">virtual_address</span><span class="f">;</span>    <span class="k">/* Faulting virtual address */</span>
<a name="197" /><span class="Maybe">     197:</span> 
<a name="198" /><span class="Maybe">     198:</span>     <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">;</span>        <span class="k">/* -&gt;fault handlers should return a</span>
<a name="199" /><span class="Maybe">     199:</span> <span class="k">                     * page here, unless VM_FAULT_NOPAGE</span>
<a name="200" /><span class="Maybe">     200:</span> <span class="k">                     * is set (which is also implied by</span>
<a name="201" /><span class="Maybe">     201:</span> <span class="k">                     * VM_FAULT_ERROR).</span>
<a name="202" /><span class="Maybe">     202:</span> <span class="k">                     */</span>
<a name="203" /><span class="Maybe">     203:</span> <span class="f">}</span><span class="f">;</span>
<a name="204" /><span class="Maybe">     204:</span> 
<a name="205" /><span class="Maybe">     205:</span> <span class="k">/*</span>
<a name="206" /><span class="Maybe">     206:</span> <span class="k"> * These are the virtual MM functions - opening of an area, closing and</span>
<a name="207" /><span class="Maybe">     207:</span> <span class="k"> * unmapping it (needed to keep files on disk up-to-date etc), pointer</span>
<a name="208" /><span class="Maybe">     208:</span> <span class="k"> * to the functions called when a no-page or a wp-page exception occurs. </span>
<a name="209" /><span class="Maybe">     209:</span> <span class="k"> */</span>
<a name="210" /><span class="Maybe">     210:</span> <span class="m">struct</span> <span class="b">vm_operations_struct</span> <span class="f">{</span>
<a name="211" /><span class="Maybe">     211:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">open</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span> <span class="b">area</span><span class="f">)</span><span class="f">;</span>
<a name="212" /><span class="Maybe">     212:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">close</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span> <span class="b">area</span><span class="f">)</span><span class="f">;</span>
<a name="213" /><span class="Maybe">     213:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">fault</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_fault</span> <span class="f">*</span><span class="b">vmf</span><span class="f">)</span><span class="f">;</span>
<a name="214" /><span class="Maybe">     214:</span> 
<a name="215" /><span class="Maybe">     215:</span>     <span class="k">/* notification that a previously read-only page is about to become</span>
<a name="216" /><span class="Maybe">     216:</span> <span class="k">     * writable, if an error is returned it will cause a SIGBUS */</span>
<a name="217" /><span class="Maybe">     217:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">page_mkwrite</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_fault</span> <span class="f">*</span><span class="b">vmf</span><span class="f">)</span><span class="f">;</span>
<a name="218" /><span class="Maybe">     218:</span> 
<a name="219" /><span class="Maybe">     219:</span>     <span class="k">/* called by access_process_vm when get_user_pages() fails, typically</span>
<a name="220" /><span class="Maybe">     220:</span> <span class="k">     * for use by special VMAs that can switch between memory and hardware</span>
<a name="221" /><span class="Maybe">     221:</span> <span class="k">     */</span>
<a name="222" /><span class="Maybe">     222:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">access</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="223" /><span class="Maybe">     223:</span>               <span class="m">void</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="m">int</span> <span class="b">len</span><span class="f">,</span> <span class="m">int</span> <span class="b">write</span><span class="f">)</span><span class="f">;</span>
<a name="224" /><span class="Maybe">     224:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX05VTUFfMA__"><span class="b">CONFIG_NUMA</span></a>
<a name="225" /><span class="Maybe">     225:</span>     <span class="k">/*</span>
<a name="226" /><span class="Maybe">     226:</span> <span class="k">     * set_policy() op must add a reference to any non-NULL @new mempolicy</span>
<a name="227" /><span class="Maybe">     227:</span> <span class="k">     * to hold the policy upon return.  Caller should pass NULL @new to</span>
<a name="228" /><span class="Maybe">     228:</span> <span class="k">     * remove a policy and fall back to surrounding context--i.e. do not</span>
<a name="229" /><span class="Maybe">     229:</span> <span class="k">     * install a MPOL_DEFAULT policy, nor the task or system default</span>
<a name="230" /><span class="Maybe">     230:</span> <span class="k">     * mempolicy.</span>
<a name="231" /><span class="Maybe">     231:</span> <span class="k">     */</span>
<a name="232" /><span class="Maybe">     232:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">set_policy</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mempolicy</span> <span class="f">*</span><span class="m">new</span><span class="f">)</span><span class="f">;</span>
<a name="233" /><span class="Maybe">     233:</span> 
<a name="234" /><span class="Maybe">     234:</span>     <span class="k">/*</span>
<a name="235" /><span class="Maybe">     235:</span> <span class="k">     * get_policy() op must add reference [mpol_get()] to any policy at</span>
<a name="236" /><span class="Maybe">     236:</span> <span class="k">     * (vma,addr) marked as MPOL_SHARED.  The shared policy infrastructure</span>
<a name="237" /><span class="Maybe">     237:</span> <span class="k">     * in mm/mempolicy.c will do this automatically.</span>
<a name="238" /><span class="Maybe">     238:</span> <span class="k">     * get_policy() must NOT add a ref if the policy at (vma,addr) is not</span>
<a name="239" /><span class="Maybe">     239:</span> <span class="k">     * marked as MPOL_SHARED. vma policies are protected by the mmap_sem.</span>
<a name="240" /><span class="Maybe">     240:</span> <span class="k">     * If no [shared/vma] mempolicy exists at the addr, get_policy() op</span>
<a name="241" /><span class="Maybe">     241:</span> <span class="k">     * must return NULL--i.e., do not &quot;fallback&quot; to task or system default</span>
<a name="242" /><span class="Maybe">     242:</span> <span class="k">     * policy.</span>
<a name="243" /><span class="Maybe">     243:</span> <span class="k">     */</span>
<a name="244" /><span class="Maybe">     244:</span>     <span class="m">struct</span> <span class="b">mempolicy</span> <span class="f">*</span><span class="f">(</span><span class="f">*</span><span class="b">get_policy</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="245" /><span class="Maybe">     245:</span>                     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="246" /><span class="Maybe">     246:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">migrate</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">const</span> <span class="b">nodemask_t</span> <span class="f">*</span><span class="b">from</span><span class="f">,</span>
<a name="247" /><span class="Maybe">     247:</span>         <span class="m">const</span> <span class="b">nodemask_t</span> <span class="f">*</span><span class="b">to</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="248" /><span class="Maybe">     248:</span> <span class="f">#</span><span class="n">endif</span>
<a name="249" /><span class="Maybe">     249:</span>     <span class="k">/* called by sys_remap_file_pages() to populate non-linear mapping */</span>
<a name="250" /><span class="Maybe">     250:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">remap_pages</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="251" /><span class="Maybe">     251:</span>                <span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">pgoff</span><span class="f">)</span><span class="f">;</span>
<a name="252" /><span class="Maybe">     252:</span> <span class="f">}</span><span class="f">;</span>
<a name="253" /><span class="Maybe">     253:</span> 
<a name="254" /><span class="Maybe">     254:</span> <span class="m">struct</span> <span class="b">mmu_gather</span><span class="f">;</span>
<a name="255" /><span class="Maybe">     255:</span> <span class="m">struct</span> <span class="b">inode</span><span class="f">;</span>
<a name="256" /><span class="Maybe">     256:</span> 
<a name="257" /><span class="Maybe">     257:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_cGFnZV9wcml2YXRlXzA_"><span class="b">page_private</span></a><span class="f">(</span><span class="b">page</span><span class="f">)</span>        <span class="f">(</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">-&gt;</span><span class="m">private</span><span class="f">)</span>
<a name="258" /><span class="Maybe">     258:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_c2V0X3BhZ2VfcHJpdmF0ZV8w"><span class="b">set_page_private</span></a><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">v</span><span class="f">)</span>    <span class="f">(</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">-&gt;</span><span class="m">private</span> <span class="f">=</span> <span class="f">(</span><span class="b">v</span><span class="f">)</span><span class="f">)</span>
<a name="259" /><span class="Maybe">     259:</span> 
<a name="260" /><span class="Maybe">     260:</span> <span class="k">/* It&apos;s valid only if the page is free path or free_list */</span>
<a name="261" /><span class="Maybe">     261:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_freepage_migratetype</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">migratetype</span><span class="f">)</span>
<a name="262" /><span class="Maybe">     262:</span> <span class="f">{</span>
<a name="263" /><span class="Maybe">     263:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">index</span> <span class="f">=</span> <span class="b">migratetype</span><span class="f">;</span>
<a name="264" /><span class="Maybe">     264:</span> <span class="f">}</span>
<a name="265" /><span class="Maybe">     265:</span> 
<a name="266" /><span class="Maybe">     266:</span> <span class="k">/* It&apos;s valid only if the page is free path or free_list */</span>
<a name="267" /><span class="Maybe">     267:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">get_freepage_migratetype</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="268" /><span class="Maybe">     268:</span> <span class="f">{</span>
<a name="269" /><span class="Maybe">     269:</span>     <span class="m">return</span> <span class="b">page</span><span class="f">-&gt;</span><span class="b">index</span><span class="f">;</span>
<a name="270" /><span class="Maybe">     270:</span> <span class="f">}</span>
<a name="271" /><span class="Maybe">     271:</span> 
<a name="272" /><span class="Maybe">     272:</span> <span class="k">/*</span>
<a name="273" /><span class="Maybe">     273:</span> <span class="k"> * FIXME: take this include out, include page-flags.h in</span>
<a name="274" /><span class="Maybe">     274:</span> <span class="k"> * files which need it (119 of them)</span>
<a name="275" /><span class="Maybe">     275:</span> <span class="k"> */</span>
<a name="276" /><span class="Maybe">     276:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">page</span><span class="f">-</span><span class="b">flags</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="277" /><span class="Maybe">     277:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">huge_mm</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="278" /><span class="Maybe">     278:</span> 
<a name="279" /><span class="Maybe">     279:</span> <span class="k">/*</span>
<a name="280" /><span class="Maybe">     280:</span> <span class="k"> * Methods to modify the page usage count.</span>
<a name="281" /><span class="Maybe">     281:</span> <span class="k"> *</span>
<a name="282" /><span class="Maybe">     282:</span> <span class="k"> * What counts for a page usage:</span>
<a name="283" /><span class="Maybe">     283:</span> <span class="k"> * - cache mapping   (page-&gt;mapping)</span>
<a name="284" /><span class="Maybe">     284:</span> <span class="k"> * - private data    (page-&gt;private)</span>
<a name="285" /><span class="Maybe">     285:</span> <span class="k"> * - page mapped in a task&apos;s page tables, each mapping</span>
<a name="286" /><span class="Maybe">     286:</span> <span class="k"> *   is counted separately</span>
<a name="287" /><span class="Maybe">     287:</span> <span class="k"> *</span>
<a name="288" /><span class="Maybe">     288:</span> <span class="k"> * Also, many kernel routines increase the page count before a critical</span>
<a name="289" /><span class="Maybe">     289:</span> <span class="k"> * routine so they can be sure the page doesn&apos;t go away from under them.</span>
<a name="290" /><span class="Maybe">     290:</span> <span class="k"> */</span>
<a name="291" /><span class="Maybe">     291:</span> 
<a name="292" /><span class="Maybe">     292:</span> <span class="k">/*</span>
<a name="293" /><span class="Maybe">     293:</span> <span class="k"> * Drop a ref, return true if the refcount fell to zero (the page has no users)</span>
<a name="294" /><span class="Maybe">     294:</span> <span class="k"> */</span>
<a name="295" /><span class="Maybe">     295:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">put_page_testzero</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="296" /><span class="Maybe">     296:</span> <span class="f">{</span>
<a name="297" /><span class="Maybe">     297:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="b">atomic_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_count</span><span class="f">)</span> <span class="f">==</span> <span class="c">0</span><span class="f">)</span><span class="f">;</span>
<a name="298" /><span class="Maybe">     298:</span>     <span class="m">return</span> <span class="b">atomic_dec_and_test</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_count</span><span class="f">)</span><span class="f">;</span>
<a name="299" /><span class="Maybe">     299:</span> <span class="f">}</span>
<a name="300" /><span class="Maybe">     300:</span> 
<a name="301" /><span class="Maybe">     301:</span> <span class="k">/*</span>
<a name="302" /><span class="Maybe">     302:</span> <span class="k"> * Try to grab a ref unless the page has a refcount of zero, return false if</span>
<a name="303" /><span class="Maybe">     303:</span> <span class="k"> * that is the case.</span>
<a name="304" /><span class="Maybe">     304:</span> <span class="k"> * This can be called when MMU is off so it must not access</span>
<a name="305" /><span class="Maybe">     305:</span> <span class="k"> * any of the virtual mappings.</span>
<a name="306" /><span class="Maybe">     306:</span> <span class="k"> */</span>
<a name="307" /><span class="Maybe">     307:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">get_page_unless_zero</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="308" /><span class="Maybe">     308:</span> <span class="f">{</span>
<a name="309" /><span class="Maybe">     309:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_YXRvbWljX2luY19ub3RfemVyb18w"><span class="b">atomic_inc_not_zero</span></a><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_count</span><span class="f">)</span><span class="f">;</span>
<a name="310" /><span class="Maybe">     310:</span> <span class="f">}</span>
<a name="311" /><span class="Maybe">     311:</span> 
<a name="312" /><span class="Maybe">     312:</span> <span class="k">/*</span>
<a name="313" /><span class="Maybe">     313:</span> <span class="k"> * Try to drop a ref unless the page has a refcount of one, return false if</span>
<a name="314" /><span class="Maybe">     314:</span> <span class="k"> * that is the case.</span>
<a name="315" /><span class="Maybe">     315:</span> <span class="k"> * This is to make sure that the refcount won&apos;t become zero after this drop.</span>
<a name="316" /><span class="Maybe">     316:</span> <span class="k"> * This can be called when MMU is off so it must not access</span>
<a name="317" /><span class="Maybe">     317:</span> <span class="k"> * any of the virtual mappings.</span>
<a name="318" /><span class="Maybe">     318:</span> <span class="k"> */</span>
<a name="319" /><span class="Maybe">     319:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">put_page_unless_one</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="320" /><span class="Maybe">     320:</span> <span class="f">{</span>
<a name="321" /><span class="Maybe">     321:</span>     <span class="m">return</span> <span class="b">atomic_add_unless</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_count</span><span class="f">,</span> <span class="f">-</span><span class="c">1</span><span class="f">,</span> <span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="322" /><span class="Maybe">     322:</span> <span class="f">}</span>
<a name="323" /><span class="Maybe">     323:</span> 
<a name="324" /><span class="Maybe">     324:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">page_is_ram</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">)</span><span class="f">;</span>
<a name="325" /><span class="Maybe">     325:</span> 
<a name="326" /><span class="Maybe">     326:</span> <span class="k">/* Support for virtually mapped pages */</span>
<a name="327" /><span class="Maybe">     327:</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">vmalloc_to_page</span><span class="f">(</span><span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="328" /><span class="Maybe">     328:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">vmalloc_to_pfn</span><span class="f">(</span><span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="329" /><span class="Maybe">     329:</span> 
<a name="330" /><span class="Maybe">     330:</span> <span class="k">/*</span>
<a name="331" /><span class="Maybe">     331:</span> <span class="k"> * Determine if an address is within the vmalloc range</span>
<a name="332" /><span class="Maybe">     332:</span> <span class="k"> *</span>
<a name="333" /><span class="Maybe">     333:</span> <span class="k"> * On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there</span>
<a name="334" /><span class="Maybe">     334:</span> <span class="k"> * is no special casing required.</span>
<a name="335" /><span class="Maybe">     335:</span> <span class="k"> */</span>
<a name="336" /><span class="Maybe">     336:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">is_vmalloc_addr</span><span class="f">(</span><span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">x</span><span class="f">)</span>
<a name="337" /><span class="Maybe">     337:</span> <span class="f">{</span>
<a name="338" /><span class="Maybe">     338:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a>
<a name="339" /><span class="Maybe">     339:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span> <span class="f">=</span> <span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="b">x</span><span class="f">;</span>
<a name="340" /><span class="Maybe">     340:</span> 
<a name="341" /><span class="Maybe">     341:</span>     <span class="m">return</span> <span class="b">addr</span> <span class="f">&gt;=</span> <a href="cpu.c_macros_ref.html#_Vk1BTExPQ19TVEFSVF8w"><span class="b">VMALLOC_START</span></a> <span class="f">&amp;&amp;</span> <span class="b">addr</span> <span class="f">&lt;</span> <a href="cpu.c_macros_ref.html#_Vk1BTExPQ19FTkRfMA__"><span class="b">VMALLOC_END</span></a><span class="f">;</span>
<a name="342" /><span class="False">     342:</span> <span class="f">#</span><span class="n">else</span>
<a name="343" /><span class="False">     343:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="344" /><span class="Maybe">     344:</span> <span class="f">#</span><span class="n">endif</span>
<a name="345" /><span class="Maybe">     345:</span> <span class="f">}</span>
<a name="346" /><span class="Maybe">     346:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a>
<a name="347" /><span class="Maybe">     347:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">is_vmalloc_or_module_addr</span><span class="f">(</span><span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">x</span><span class="f">)</span><span class="f">;</span>
<a name="348" /><span class="False">     348:</span> <span class="f">#</span><span class="n">else</span>
<a name="349" /><span class="False">     349:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">is_vmalloc_or_module_addr</span><span class="f">(</span><span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">x</span><span class="f">)</span>
<a name="350" /><span class="False">     350:</span> <span class="f">{</span>
<a name="351" /><span class="False">     351:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="352" /><span class="False">     352:</span> <span class="f">}</span>
<a name="353" /><span class="Maybe">     353:</span> <span class="f">#</span><span class="n">endif</span>
<a name="354" /><span class="Maybe">     354:</span> 
<a name="355" /><span class="Maybe">     355:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">compound_lock</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="356" /><span class="Maybe">     356:</span> <span class="f">{</span>
<a name="357" /><span class="False">     357:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_TRANSPARENT_HUGEPAGE</span>
<a name="358" /><span class="False">     358:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="b">PageSlab</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="359" /><span class="False">     359:</span>     <span class="b">bit_spin_lock</span><span class="f">(</span><span class="b">PG_compound_lock</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="360" /><span class="Maybe">     360:</span> <span class="f">#</span><span class="n">endif</span>
<a name="361" /><span class="Maybe">     361:</span> <span class="f">}</span>
<a name="362" /><span class="Maybe">     362:</span> 
<a name="363" /><span class="Maybe">     363:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">compound_unlock</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="364" /><span class="Maybe">     364:</span> <span class="f">{</span>
<a name="365" /><span class="False">     365:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_TRANSPARENT_HUGEPAGE</span>
<a name="366" /><span class="False">     366:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="b">PageSlab</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="367" /><span class="False">     367:</span>     <span class="b">bit_spin_unlock</span><span class="f">(</span><span class="b">PG_compound_lock</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="368" /><span class="Maybe">     368:</span> <span class="f">#</span><span class="n">endif</span>
<a name="369" /><span class="Maybe">     369:</span> <span class="f">}</span>
<a name="370" /><span class="Maybe">     370:</span> 
<a name="371" /><span class="Maybe">     371:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">compound_lock_irqsave</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="372" /><span class="Maybe">     372:</span> <span class="f">{</span>
<a name="373" /><span class="Maybe">     373:</span>     <span class="m">unsigned</span> <span class="m">long</span> <a href="cpu.c_macros_ref.html#_dW5pbml0aWFsaXplZF92YXJfMA__"><span class="b">uninitialized_var</span></a><span class="f">(</span><span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="374" /><span class="False">     374:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_TRANSPARENT_HUGEPAGE</span>
<a name="375" /><span class="False">     375:</span>     <a href="cpu.c_macros_ref.html#_bG9jYWxfaXJxX3NhdmVfMA__"><span class="b">local_irq_save</span></a><span class="f">(</span><span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="376" /><span class="False">     376:</span>     <span class="b">compound_lock</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="377" /><span class="Maybe">     377:</span> <span class="f">#</span><span class="n">endif</span>
<a name="378" /><span class="Maybe">     378:</span>     <span class="m">return</span> <span class="b">flags</span><span class="f">;</span>
<a name="379" /><span class="Maybe">     379:</span> <span class="f">}</span>
<a name="380" /><span class="Maybe">     380:</span> 
<a name="381" /><span class="Maybe">     381:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">compound_unlock_irqrestore</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="382" /><span class="Maybe">     382:</span>                           <span class="m">unsigned</span> <span class="m">long</span> <span class="b">flags</span><span class="f">)</span>
<a name="383" /><span class="Maybe">     383:</span> <span class="f">{</span>
<a name="384" /><span class="False">     384:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_TRANSPARENT_HUGEPAGE</span>
<a name="385" /><span class="False">     385:</span>     <span class="b">compound_unlock</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="386" /><span class="False">     386:</span>     <a href="cpu.c_macros_ref.html#_bG9jYWxfaXJxX3Jlc3RvcmVfMA__"><span class="b">local_irq_restore</span></a><span class="f">(</span><span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="387" /><span class="Maybe">     387:</span> <span class="f">#</span><span class="n">endif</span>
<a name="388" /><span class="Maybe">     388:</span> <span class="f">}</span>
<a name="389" /><span class="Maybe">     389:</span> 
<a name="390" /><span class="Maybe">     390:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">compound_head</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="391" /><span class="Maybe">     391:</span> <span class="f">{</span>
<a name="392" /><span class="Maybe">     392:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">PageTail</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="393" /><span class="Maybe">     393:</span>         <span class="m">return</span> <span class="b">page</span><span class="f">-&gt;</span><span class="b">first_page</span><span class="f">;</span>
<a name="394" /><span class="Maybe">     394:</span>     <span class="m">return</span> <span class="b">page</span><span class="f">;</span>
<a name="395" /><span class="Maybe">     395:</span> <span class="f">}</span>
<a name="396" /><span class="Maybe">     396:</span> 
<a name="397" /><span class="Maybe">     397:</span> <span class="k">/*</span>
<a name="398" /><span class="Maybe">     398:</span> <span class="k"> * The atomic page-&gt;_mapcount, starts from -1: so that transitions</span>
<a name="399" /><span class="Maybe">     399:</span> <span class="k"> * both from it and to it can be tracked, using atomic_inc_and_test</span>
<a name="400" /><span class="Maybe">     400:</span> <span class="k"> * and atomic_add_negative(-1).</span>
<a name="401" /><span class="Maybe">     401:</span> <span class="k"> */</span>
<a name="402" /><span class="Maybe">     402:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">page_mapcount_reset</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="403" /><span class="Maybe">     403:</span> <span class="f">{</span>
<a name="404" /><span class="Maybe">     404:</span>     <span class="b">atomic_set</span><span class="f">(</span><span class="f">&amp;</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">_mapcount</span><span class="f">,</span> <span class="f">-</span><span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="405" /><span class="Maybe">     405:</span> <span class="f">}</span>
<a name="406" /><span class="Maybe">     406:</span> 
<a name="407" /><span class="Maybe">     407:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_mapcount</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="408" /><span class="Maybe">     408:</span> <span class="f">{</span>
<a name="409" /><span class="Maybe">     409:</span>     <span class="m">return</span> <span class="b">atomic_read</span><span class="f">(</span><span class="f">&amp;</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">_mapcount</span><span class="f">)</span> <span class="f">+</span> <span class="c">1</span><span class="f">;</span>
<a name="410" /><span class="Maybe">     410:</span> <span class="f">}</span>
<a name="411" /><span class="Maybe">     411:</span> 
<a name="412" /><span class="Maybe">     412:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_count</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="413" /><span class="Maybe">     413:</span> <span class="f">{</span>
<a name="414" /><span class="Maybe">     414:</span>     <span class="m">return</span> <span class="b">atomic_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">compound_head</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">_count</span><span class="f">)</span><span class="f">;</span>
<a name="415" /><span class="Maybe">     415:</span> <span class="f">}</span>
<a name="416" /><span class="Maybe">     416:</span> 
<a name="417" /><span class="Maybe">     417:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">get_huge_page_tail</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="418" /><span class="Maybe">     418:</span> <span class="f">{</span>
<a name="419" /><span class="Maybe">     419:</span>     <span class="k">/*</span>
<a name="420" /><span class="Maybe">     420:</span> <span class="k">     * __split_huge_page_refcount() cannot run</span>
<a name="421" /><span class="Maybe">     421:</span> <span class="k">     * from under us.</span>
<a name="422" /><span class="Maybe">     422:</span> <span class="k">     */</span>
<a name="423" /><span class="Maybe">     423:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="b">page_mapcount</span><span class="f">(</span><span class="b">page</span><span class="f">)</span> <span class="f">&lt;</span> <span class="c">0</span><span class="f">)</span><span class="f">;</span>
<a name="424" /><span class="Maybe">     424:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="b">atomic_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_count</span><span class="f">)</span> <span class="f">!=</span> <span class="c">0</span><span class="f">)</span><span class="f">;</span>
<a name="425" /><span class="Maybe">     425:</span>     <span class="b">atomic_inc</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_mapcount</span><span class="f">)</span><span class="f">;</span>
<a name="426" /><span class="Maybe">     426:</span> <span class="f">}</span>
<a name="427" /><span class="Maybe">     427:</span> 
<a name="428" /><span class="Maybe">     428:</span> <span class="m">extern</span> <span class="m">bool</span> <span class="b">__get_page_tail</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="429" /><span class="Maybe">     429:</span> 
<a name="430" /><span class="Maybe">     430:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">get_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="431" /><span class="Maybe">     431:</span> <span class="f">{</span>
<a name="432" /><span class="Maybe">     432:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">PageTail</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="433" /><span class="Maybe">     433:</span>         <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_bGlrZWx5XzA_"><span class="b">likely</span></a><span class="f">(</span><span class="b">__get_page_tail</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="434" /><span class="Maybe">     434:</span>             <span class="m">return</span><span class="f">;</span>
<a name="435" /><span class="Maybe">     435:</span>     <span class="k">/*</span>
<a name="436" /><span class="Maybe">     436:</span> <span class="k">     * Getting a normal page or the head of a compound page</span>
<a name="437" /><span class="Maybe">     437:</span> <span class="k">     * requires to already have an elevated page-&gt;_count.</span>
<a name="438" /><span class="Maybe">     438:</span> <span class="k">     */</span>
<a name="439" /><span class="Maybe">     439:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="b">atomic_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_count</span><span class="f">)</span> <span class="f">&lt;=</span> <span class="c">0</span><span class="f">)</span><span class="f">;</span>
<a name="440" /><span class="Maybe">     440:</span>     <span class="b">atomic_inc</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_count</span><span class="f">)</span><span class="f">;</span>
<a name="441" /><span class="Maybe">     441:</span> <span class="f">}</span>
<a name="442" /><span class="Maybe">     442:</span> 
<a name="443" /><span class="Maybe">     443:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">virt_to_head_page</span><span class="f">(</span><span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="b">x</span><span class="f">)</span>
<a name="444" /><span class="Maybe">     444:</span> <span class="f">{</span>
<a name="445" /><span class="Maybe">     445:</span>     <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span> <span class="f">=</span> <a href="cpu.c_macros_ref.html#_dmlydF90b19wYWdlXzA_"><span class="b">virt_to_page</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span><span class="f">;</span>
<a name="446" /><span class="Maybe">     446:</span>     <span class="m">return</span> <span class="b">compound_head</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="447" /><span class="Maybe">     447:</span> <span class="f">}</span>
<a name="448" /><span class="Maybe">     448:</span> 
<a name="449" /><span class="Maybe">     449:</span> <span class="k">/*</span>
<a name="450" /><span class="Maybe">     450:</span> <span class="k"> * Setup the page count before being freed into the page allocator for</span>
<a name="451" /><span class="Maybe">     451:</span> <span class="k"> * the first time (boot or memory hotplug)</span>
<a name="452" /><span class="Maybe">     452:</span> <span class="k"> */</span>
<a name="453" /><span class="Maybe">     453:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">init_page_count</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="454" /><span class="Maybe">     454:</span> <span class="f">{</span>
<a name="455" /><span class="Maybe">     455:</span>     <span class="b">atomic_set</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_count</span><span class="f">,</span> <span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="456" /><span class="Maybe">     456:</span> <span class="f">}</span>
<a name="457" /><span class="Maybe">     457:</span> 
<a name="458" /><span class="Maybe">     458:</span> <span class="k">/*</span>
<a name="459" /><span class="Maybe">     459:</span> <span class="k"> * PageBuddy() indicate that the page is free and in the buddy system</span>
<a name="460" /><span class="Maybe">     460:</span> <span class="k"> * (see mm/page_alloc.c).</span>
<a name="461" /><span class="Maybe">     461:</span> <span class="k"> *</span>
<a name="462" /><span class="Maybe">     462:</span> <span class="k"> * PAGE_BUDDY_MAPCOUNT_VALUE must be &lt;= -2 but better not too close to</span>
<a name="463" /><span class="Maybe">     463:</span> <span class="k"> * -2 so that an underflow of the page_mapcount() won&apos;t be mistaken</span>
<a name="464" /><span class="Maybe">     464:</span> <span class="k"> * for a genuine PAGE_BUDDY_MAPCOUNT_VALUE. -128 can be created very</span>
<a name="465" /><span class="Maybe">     465:</span> <span class="k"> * efficiently by most CPU architectures.</span>
<a name="466" /><span class="Maybe">     466:</span> <span class="k"> */</span>
<a name="467" /><span class="Maybe">     467:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_UEFHRV9CVUREWV9NQVBDT1VOVF9WQUxVRV8w"><span class="b">PAGE_BUDDY_MAPCOUNT_VALUE</span></a> <span class="f">(</span><span class="f">-</span><span class="c">128</span><span class="f">)</span>
<a name="468" /><span class="Maybe">     468:</span> 
<a name="469" /><span class="Maybe">     469:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">PageBuddy</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="470" /><span class="Maybe">     470:</span> <span class="f">{</span>
<a name="471" /><span class="Maybe">     471:</span>     <span class="m">return</span> <span class="b">atomic_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_mapcount</span><span class="f">)</span> <span class="f">==</span> <a href="cpu.c_macros_ref.html#_UEFHRV9CVUREWV9NQVBDT1VOVF9WQUxVRV8w"><span class="b">PAGE_BUDDY_MAPCOUNT_VALUE</span></a><span class="f">;</span>
<a name="472" /><span class="Maybe">     472:</span> <span class="f">}</span>
<a name="473" /><span class="Maybe">     473:</span> 
<a name="474" /><span class="Maybe">     474:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">__SetPageBuddy</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="475" /><span class="Maybe">     475:</span> <span class="f">{</span>
<a name="476" /><span class="Maybe">     476:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="b">atomic_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_mapcount</span><span class="f">)</span> <span class="f">!=</span> <span class="f">-</span><span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="477" /><span class="Maybe">     477:</span>     <span class="b">atomic_set</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_mapcount</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_UEFHRV9CVUREWV9NQVBDT1VOVF9WQUxVRV8w"><span class="b">PAGE_BUDDY_MAPCOUNT_VALUE</span></a><span class="f">)</span><span class="f">;</span>
<a name="478" /><span class="Maybe">     478:</span> <span class="f">}</span>
<a name="479" /><span class="Maybe">     479:</span> 
<a name="480" /><span class="Maybe">     480:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">__ClearPageBuddy</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="481" /><span class="Maybe">     481:</span> <span class="f">{</span>
<a name="482" /><span class="Maybe">     482:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="f">!</span><span class="b">PageBuddy</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="483" /><span class="Maybe">     483:</span>     <span class="b">atomic_set</span><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_mapcount</span><span class="f">,</span> <span class="f">-</span><span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="484" /><span class="Maybe">     484:</span> <span class="f">}</span>
<a name="485" /><span class="Maybe">     485:</span> 
<a name="486" /><span class="Maybe">     486:</span> <span class="m">void</span> <span class="b">put_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="487" /><span class="Maybe">     487:</span> <span class="m">void</span> <span class="b">put_pages_list</span><span class="f">(</span><span class="m">struct</span> <span class="b">list_head</span> <span class="f">*</span><span class="b">pages</span><span class="f">)</span><span class="f">;</span>
<a name="488" /><span class="Maybe">     488:</span> 
<a name="489" /><span class="Maybe">     489:</span> <span class="m">void</span> <span class="b">split_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span><span class="f">;</span>
<a name="490" /><span class="Maybe">     490:</span> <span class="m">int</span> <span class="b">split_free_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="491" /><span class="Maybe">     491:</span> 
<a name="492" /><span class="Maybe">     492:</span> <span class="k">/*</span>
<a name="493" /><span class="Maybe">     493:</span> <span class="k"> * Compound pages have a destructor function.  Provide a</span>
<a name="494" /><span class="Maybe">     494:</span> <span class="k"> * prototype for that function and accessor functions.</span>
<a name="495" /><span class="Maybe">     495:</span> <span class="k"> * These are _only_ valid on the head of a PG_compound page.</span>
<a name="496" /><span class="Maybe">     496:</span> <span class="k"> */</span>
<a name="497" /><span class="Maybe">     497:</span> <span class="m">typedef</span> <span class="m">void</span> <span class="b">compound_page_dtor</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="498" /><span class="Maybe">     498:</span> 
<a name="499" /><span class="Maybe">     499:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_compound_page_dtor</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="500" /><span class="Maybe">     500:</span>                         <span class="b">compound_page_dtor</span> <span class="f">*</span><span class="b">dtor</span><span class="f">)</span>
<a name="501" /><span class="Maybe">     501:</span> <span class="f">{</span>
<a name="502" /><span class="Maybe">     502:</span>     <span class="b">page</span><span class="f">[</span><span class="c">1</span><span class="f">]</span><span class="f">.</span><span class="b">lru</span><span class="f">.</span><span class="b">next</span> <span class="f">=</span> <span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="b">dtor</span><span class="f">;</span>
<a name="503" /><span class="Maybe">     503:</span> <span class="f">}</span>
<a name="504" /><span class="Maybe">     504:</span> 
<a name="505" /><span class="Maybe">     505:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">compound_page_dtor</span> <span class="f">*</span><span class="b">get_compound_page_dtor</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="506" /><span class="Maybe">     506:</span> <span class="f">{</span>
<a name="507" /><span class="Maybe">     507:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">compound_page_dtor</span> <span class="f">*</span><span class="f">)</span><span class="b">page</span><span class="f">[</span><span class="c">1</span><span class="f">]</span><span class="f">.</span><span class="b">lru</span><span class="f">.</span><span class="b">next</span><span class="f">;</span>
<a name="508" /><span class="Maybe">     508:</span> <span class="f">}</span>
<a name="509" /><span class="Maybe">     509:</span> 
<a name="510" /><span class="Maybe">     510:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">compound_order</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="511" /><span class="Maybe">     511:</span> <span class="f">{</span>
<a name="512" /><span class="Maybe">     512:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">!</span><span class="b">PageHead</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span>
<a name="513" /><span class="Maybe">     513:</span>         <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="514" /><span class="Maybe">     514:</span>     <span class="m">return</span> <span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="b">page</span><span class="f">[</span><span class="c">1</span><span class="f">]</span><span class="f">.</span><span class="b">lru</span><span class="f">.</span><span class="b">prev</span><span class="f">;</span>
<a name="515" /><span class="Maybe">     515:</span> <span class="f">}</span>
<a name="516" /><span class="Maybe">     516:</span> 
<a name="517" /><span class="Maybe">     517:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_compound_order</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">order</span><span class="f">)</span>
<a name="518" /><span class="Maybe">     518:</span> <span class="f">{</span>
<a name="519" /><span class="Maybe">     519:</span>     <span class="b">page</span><span class="f">[</span><span class="c">1</span><span class="f">]</span><span class="f">.</span><span class="b">lru</span><span class="f">.</span><span class="b">prev</span> <span class="f">=</span> <span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="b">order</span><span class="f">;</span>
<a name="520" /><span class="Maybe">     520:</span> <span class="f">}</span>
<a name="521" /><span class="Maybe">     521:</span> 
<a name="522" /><span class="Maybe">     522:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a>
<a name="523" /><span class="Maybe">     523:</span> <span class="k">/*</span>
<a name="524" /><span class="Maybe">     524:</span> <span class="k"> * Do pte_mkwrite, but only if the vma says VM_WRITE.  We do this when</span>
<a name="525" /><span class="Maybe">     525:</span> <span class="k"> * servicing faults for write access.  In the normal case, do always want</span>
<a name="526" /><span class="Maybe">     526:</span> <span class="k"> * pte_mkwrite.  But get_user_pages can cause write faults for mappings</span>
<a name="527" /><span class="Maybe">     527:</span> <span class="k"> * that do not have writing enabled, when used by access_process_vm.</span>
<a name="528" /><span class="Maybe">     528:</span> <span class="k"> */</span>
<a name="529" /><span class="Maybe">     529:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">pte_t</span> <span class="b">maybe_mkwrite</span><span class="f">(</span><span class="b">pte_t</span> <span class="b">pte</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">)</span>
<a name="530" /><span class="Maybe">     530:</span> <span class="f">{</span>
<a name="531" /><span class="Maybe">     531:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_bGlrZWx5XzA_"><span class="b">likely</span></a><span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Vk1fV1JJVEVfMA__"><span class="b">VM_WRITE</span></a><span class="f">)</span><span class="f">)</span>
<a name="532" /><span class="Maybe">     532:</span>         <span class="b">pte</span> <span class="f">=</span> <span class="b">pte_mkwrite</span><span class="f">(</span><span class="b">pte</span><span class="f">)</span><span class="f">;</span>
<a name="533" /><span class="Maybe">     533:</span>     <span class="m">return</span> <span class="b">pte</span><span class="f">;</span>
<a name="534" /><span class="Maybe">     534:</span> <span class="f">}</span>
<a name="535" /><span class="Maybe">     535:</span> <span class="f">#</span><span class="n">endif</span>
<a name="536" /><span class="Maybe">     536:</span> 
<a name="537" /><span class="Maybe">     537:</span> <span class="k">/*</span>
<a name="538" /><span class="Maybe">     538:</span> <span class="k"> * Multiple processes may &quot;see&quot; the same page. E.g. for untouched</span>
<a name="539" /><span class="Maybe">     539:</span> <span class="k"> * mappings of /dev/null, all processes see the same page full of</span>
<a name="540" /><span class="Maybe">     540:</span> <span class="k"> * zeroes, and text pages of executables and shared libraries have</span>
<a name="541" /><span class="Maybe">     541:</span> <span class="k"> * only one copy in memory, at most, normally.</span>
<a name="542" /><span class="Maybe">     542:</span> <span class="k"> *</span>
<a name="543" /><span class="Maybe">     543:</span> <span class="k"> * For the non-reserved pages, page_count(page) denotes a reference count.</span>
<a name="544" /><span class="Maybe">     544:</span> <span class="k"> *   page_count() == 0 means the page is free. page-&gt;lru is then used for</span>
<a name="545" /><span class="Maybe">     545:</span> <span class="k"> *   freelist management in the buddy allocator.</span>
<a name="546" /><span class="Maybe">     546:</span> <span class="k"> *   page_count() &gt; 0  means the page has been allocated.</span>
<a name="547" /><span class="Maybe">     547:</span> <span class="k"> *</span>
<a name="548" /><span class="Maybe">     548:</span> <span class="k"> * Pages are allocated by the slab allocator in order to provide memory</span>
<a name="549" /><span class="Maybe">     549:</span> <span class="k"> * to kmalloc and kmem_cache_alloc. In this case, the management of the</span>
<a name="550" /><span class="Maybe">     550:</span> <span class="k"> * page, and the fields in &apos;struct page&apos; are the responsibility of mm/slab.c</span>
<a name="551" /><span class="Maybe">     551:</span> <span class="k"> * unless a particular usage is carefully commented. (the responsibility of</span>
<a name="552" /><span class="Maybe">     552:</span> <span class="k"> * freeing the kmalloc memory is the caller&apos;s, of course).</span>
<a name="553" /><span class="Maybe">     553:</span> <span class="k"> *</span>
<a name="554" /><span class="Maybe">     554:</span> <span class="k"> * A page may be used by anyone else who does a __get_free_page().</span>
<a name="555" /><span class="Maybe">     555:</span> <span class="k"> * In this case, page_count still tracks the references, and should only</span>
<a name="556" /><span class="Maybe">     556:</span> <span class="k"> * be used through the normal accessor functions. The top bits of page-&gt;flags</span>
<a name="557" /><span class="Maybe">     557:</span> <span class="k"> * and page-&gt;virtual store page management information, but all other fields</span>
<a name="558" /><span class="Maybe">     558:</span> <span class="k"> * are unused and could be used privately, carefully. The management of this</span>
<a name="559" /><span class="Maybe">     559:</span> <span class="k"> * page is the responsibility of the one who allocated it, and those who have</span>
<a name="560" /><span class="Maybe">     560:</span> <span class="k"> * subsequently been given references to it.</span>
<a name="561" /><span class="Maybe">     561:</span> <span class="k"> *</span>
<a name="562" /><span class="Maybe">     562:</span> <span class="k"> * The other pages (we may call them &quot;pagecache pages&quot;) are completely</span>
<a name="563" /><span class="Maybe">     563:</span> <span class="k"> * managed by the Linux memory manager: I/O, buffers, swapping etc.</span>
<a name="564" /><span class="Maybe">     564:</span> <span class="k"> * The following discussion applies only to them.</span>
<a name="565" /><span class="Maybe">     565:</span> <span class="k"> *</span>
<a name="566" /><span class="Maybe">     566:</span> <span class="k"> * A pagecache page contains an opaque `private&apos; member, which belongs to the</span>
<a name="567" /><span class="Maybe">     567:</span> <span class="k"> * page&apos;s address_space. Usually, this is the address of a circular list of</span>
<a name="568" /><span class="Maybe">     568:</span> <span class="k"> * the page&apos;s disk buffers. PG_private must be set to tell the VM to call</span>
<a name="569" /><span class="Maybe">     569:</span> <span class="k"> * into the filesystem to release these pages.</span>
<a name="570" /><span class="Maybe">     570:</span> <span class="k"> *</span>
<a name="571" /><span class="Maybe">     571:</span> <span class="k"> * A page may belong to an inode&apos;s memory mapping. In this case, page-&gt;mapping</span>
<a name="572" /><span class="Maybe">     572:</span> <span class="k"> * is the pointer to the inode, and page-&gt;index is the file offset of the page,</span>
<a name="573" /><span class="Maybe">     573:</span> <span class="k"> * in units of PAGE_CACHE_SIZE.</span>
<a name="574" /><span class="Maybe">     574:</span> <span class="k"> *</span>
<a name="575" /><span class="Maybe">     575:</span> <span class="k"> * If pagecache pages are not associated with an inode, they are said to be</span>
<a name="576" /><span class="Maybe">     576:</span> <span class="k"> * anonymous pages. These may become associated with the swapcache, and in that</span>
<a name="577" /><span class="Maybe">     577:</span> <span class="k"> * case PG_swapcache is set, and page-&gt;private is an offset into the swapcache.</span>
<a name="578" /><span class="Maybe">     578:</span> <span class="k"> *</span>
<a name="579" /><span class="Maybe">     579:</span> <span class="k"> * In either case (swapcache or inode backed), the pagecache itself holds one</span>
<a name="580" /><span class="Maybe">     580:</span> <span class="k"> * reference to the page. Setting PG_private should also increment the</span>
<a name="581" /><span class="Maybe">     581:</span> <span class="k"> * refcount. The each user mapping also has a reference to the page.</span>
<a name="582" /><span class="Maybe">     582:</span> <span class="k"> *</span>
<a name="583" /><span class="Maybe">     583:</span> <span class="k"> * The pagecache pages are stored in a per-mapping radix tree, which is</span>
<a name="584" /><span class="Maybe">     584:</span> <span class="k"> * rooted at mapping-&gt;page_tree, and indexed by offset.</span>
<a name="585" /><span class="Maybe">     585:</span> <span class="k"> * Where 2.4 and early 2.6 kernels kept dirty/clean pages in per-address_space</span>
<a name="586" /><span class="Maybe">     586:</span> <span class="k"> * lists, we instead now tag pages as dirty/writeback in the radix tree.</span>
<a name="587" /><span class="Maybe">     587:</span> <span class="k"> *</span>
<a name="588" /><span class="Maybe">     588:</span> <span class="k"> * All pagecache pages may be subject to I/O:</span>
<a name="589" /><span class="Maybe">     589:</span> <span class="k"> * - inode pages may need to be read from disk,</span>
<a name="590" /><span class="Maybe">     590:</span> <span class="k"> * - inode pages which have been modified and are MAP_SHARED may need</span>
<a name="591" /><span class="Maybe">     591:</span> <span class="k"> *   to be written back to the inode on disk,</span>
<a name="592" /><span class="Maybe">     592:</span> <span class="k"> * - anonymous pages (including MAP_PRIVATE file mappings) which have been</span>
<a name="593" /><span class="Maybe">     593:</span> <span class="k"> *   modified may need to be swapped out to swap space and (later) to be read</span>
<a name="594" /><span class="Maybe">     594:</span> <span class="k"> *   back into memory.</span>
<a name="595" /><span class="Maybe">     595:</span> <span class="k"> */</span>
<a name="596" /><span class="Maybe">     596:</span> 
<a name="597" /><span class="Maybe">     597:</span> <span class="k">/*</span>
<a name="598" /><span class="Maybe">     598:</span> <span class="k"> * The zone field is never updated after free_area_init_core()</span>
<a name="599" /><span class="Maybe">     599:</span> <span class="k"> * sets it, so none of the operations on it need to be atomic.</span>
<a name="600" /><span class="Maybe">     600:</span> <span class="k"> */</span>
<a name="601" /><span class="Maybe">     601:</span> 
<a name="602" /><span class="Maybe">     602:</span> <span class="k">/* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_CPUPID] | ... | FLAGS | */</span>
<a name="603" /><span class="Maybe">     603:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_U0VDVElPTlNfUEdPRkZfMA__"><span class="b">SECTIONS_PGOFF</span></a>        <span class="f">(</span><span class="f">(</span><span class="m">sizeof</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="f">*</span><span class="c">8</span><span class="f">)</span> <span class="f">-</span> <a href="cpu.c_macros_ref.html#_U0VDVElPTlNfV0lEVEhfMA__"><span class="b">SECTIONS_WIDTH</span></a><span class="f">)</span>
<a name="604" /><span class="Maybe">     604:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfUEdPRkZfMA__"><span class="b">NODES_PGOFF</span></a>        <span class="f">(</span><a href="cpu.c_macros_ref.html#_U0VDVElPTlNfUEdPRkZfMA__"><span class="b">SECTIONS_PGOFF</span></a> <span class="f">-</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfV0lEVEhfMA__"><span class="b">NODES_WIDTH</span></a><span class="f">)</span>
<a name="605" /><span class="Maybe">     605:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdPRkZfMA__"><span class="b">ZONES_PGOFF</span></a>        <span class="f">(</span><a href="cpu.c_macros_ref.html#_Tk9ERVNfUEdPRkZfMA__"><span class="b">NODES_PGOFF</span></a> <span class="f">-</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfV0lEVEhfMA__"><span class="b">ZONES_WIDTH</span></a><span class="f">)</span>
<a name="606" /><span class="Maybe">     606:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfUEdPRkZfMA__"><span class="b">LAST_CPUPID_PGOFF</span></a>    <span class="f">(</span><a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdPRkZfMA__"><span class="b">ZONES_PGOFF</span></a> <span class="f">-</span> <a href="cpu.c_macros_ref.html#_TEFTVF9DUFVQSURfV0lEVEhfMA__"><span class="b">LAST_CPUPID_WIDTH</span></a><span class="f">)</span>
<a name="607" /><span class="Maybe">     607:</span> 
<a name="608" /><span class="Maybe">     608:</span> <span class="k">/*</span>
<a name="609" /><span class="Maybe">     609:</span> <span class="k"> * Define the bit shifts to access each section.  For non-existent</span>
<a name="610" /><span class="Maybe">     610:</span> <span class="k"> * sections we define the shift as 0; that plus a 0 mask ensures</span>
<a name="611" /><span class="Maybe">     611:</span> <span class="k"> * the compiler will optimise away reference to them.</span>
<a name="612" /><span class="Maybe">     612:</span> <span class="k"> */</span>
<a name="613" /><span class="Maybe">     613:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U0VDVElPTlNfUEdTSElGVF8w"><span class="b">SECTIONS_PGSHIFT</span></a>    <span class="f">(</span><a href="cpu.c_macros_ref.html#_U0VDVElPTlNfUEdPRkZfMA__"><span class="b">SECTIONS_PGOFF</span></a> <span class="f">*</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_U0VDVElPTlNfV0lEVEhfMA__"><span class="b">SECTIONS_WIDTH</span></a> <span class="f">!=</span> <span class="c">0</span><span class="f">)</span><span class="f">)</span>
<a name="614" /><span class="Maybe">     614:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfUEdTSElGVF8w"><span class="b">NODES_PGSHIFT</span></a>        <span class="f">(</span><a href="cpu.c_macros_ref.html#_Tk9ERVNfUEdPRkZfMA__"><span class="b">NODES_PGOFF</span></a> <span class="f">*</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_Tk9ERVNfV0lEVEhfMA__"><span class="b">NODES_WIDTH</span></a> <span class="f">!=</span> <span class="c">0</span><span class="f">)</span><span class="f">)</span>
<a name="615" /><span class="Maybe">     615:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdTSElGVF8w"><span class="b">ZONES_PGSHIFT</span></a>        <span class="f">(</span><a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdPRkZfMA__"><span class="b">ZONES_PGOFF</span></a> <span class="f">*</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_Wk9ORVNfV0lEVEhfMA__"><span class="b">ZONES_WIDTH</span></a> <span class="f">!=</span> <span class="c">0</span><span class="f">)</span><span class="f">)</span>
<a name="616" /><span class="Maybe">     616:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfUEdTSElGVF8w"><span class="b">LAST_CPUPID_PGSHIFT</span></a>    <span class="f">(</span><a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfUEdPRkZfMA__"><span class="b">LAST_CPUPID_PGOFF</span></a> <span class="f">*</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_TEFTVF9DUFVQSURfV0lEVEhfMA__"><span class="b">LAST_CPUPID_WIDTH</span></a> <span class="f">!=</span> <span class="c">0</span><span class="f">)</span><span class="f">)</span>
<a name="617" /><span class="Maybe">     617:</span> 
<a name="618" /><span class="Maybe">     618:</span> <span class="k">/* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */</span>
<a name="619" /><span class="Maybe">     619:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Tk9ERV9OT1RfSU5fUEFHRV9GTEFHU18w"><span class="b">NODE_NOT_IN_PAGE_FLAGS</span></a>
<a name="620" /><span class="Maybe">     620:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Wk9ORUlEX1NISUZUXzA_"><span class="b">ZONEID_SHIFT</span></a>        <span class="f">(</span><a href="cpu.c_macros_ref.html#_U0VDVElPTlNfU0hJRlRfMA__"><span class="b">SECTIONS_SHIFT</span></a> <span class="f">+</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfU0hJRlRfMA__"><span class="b">ZONES_SHIFT</span></a><span class="f">)</span>
<a name="621" /><span class="Maybe">     621:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Wk9ORUlEX1BHT0ZGXzA_"><span class="b">ZONEID_PGOFF</span></a>        <span class="f">(</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_U0VDVElPTlNfUEdPRkZfMA__"><span class="b">SECTIONS_PGOFF</span></a> <span class="f">&lt;</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdPRkZfMA__"><span class="b">ZONES_PGOFF</span></a><span class="f">)</span><span class="f">?</span> \
<a name="622" /><span class="Maybe">     622:</span>                         <a href="cpu.c_macros_ref.html#_U0VDVElPTlNfUEdPRkZfMA__"><span class="b">SECTIONS_PGOFF</span></a> <span class="f">:</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdPRkZfMA__"><span class="b">ZONES_PGOFF</span></a><span class="f">)</span>
<a name="623" /><span class="False">     623:</span> <span class="f">#</span><span class="n">else</span>
<a name="624" /><span class="False">     624:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Wk9ORUlEX1NISUZUXzA_"><span class="b">ZONEID_SHIFT</span></a>        <span class="f">(</span><a href="cpu.c_macros_ref.html#_Tk9ERVNfU0hJRlRfMA__"><span class="b">NODES_SHIFT</span></a> <span class="f">+</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfU0hJRlRfMA__"><span class="b">ZONES_SHIFT</span></a><span class="f">)</span>
<a name="625" /><span class="False">     625:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Wk9ORUlEX1BHT0ZGXzA_"><span class="b">ZONEID_PGOFF</span></a>        <span class="f">(</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Tk9ERVNfUEdPRkZfMA__"><span class="b">NODES_PGOFF</span></a> <span class="f">&lt;</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdPRkZfMA__"><span class="b">ZONES_PGOFF</span></a><span class="f">)</span><span class="f">?</span> \
<a name="626" /><span class="False">     626:</span>                         <a href="cpu.c_macros_ref.html#_Tk9ERVNfUEdPRkZfMA__"><span class="b">NODES_PGOFF</span></a> <span class="f">:</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdPRkZfMA__"><span class="b">ZONES_PGOFF</span></a><span class="f">)</span>
<a name="627" /><span class="Maybe">     627:</span> <span class="f">#</span><span class="n">endif</span>
<a name="628" /><span class="Maybe">     628:</span> 
<a name="629" /><span class="Maybe">     629:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Wk9ORUlEX1BHU0hJRlRfMA__"><span class="b">ZONEID_PGSHIFT</span></a>        <span class="f">(</span><a href="cpu.c_macros_ref.html#_Wk9ORUlEX1BHT0ZGXzA_"><span class="b">ZONEID_PGOFF</span></a> <span class="f">*</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_Wk9ORUlEX1NISUZUXzA_"><span class="b">ZONEID_SHIFT</span></a> <span class="f">!=</span> <span class="c">0</span><span class="f">)</span><span class="f">)</span>
<a name="630" /><span class="Maybe">     630:</span> 
<a name="631" /><span class="False">     631:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_U0VDVElPTlNfV0lEVEhfMA__"><span class="b">SECTIONS_WIDTH</span></a><span class="f">+</span><a href="cpu.c_macros_ref.html#_Tk9ERVNfV0lEVEhfMA__"><span class="b">NODES_WIDTH</span></a><span class="f">+</span><a href="cpu.c_macros_ref.html#_Wk9ORVNfV0lEVEhfMA__"><span class="b">ZONES_WIDTH</span></a> <span class="f">&gt;</span> <a href="cpu.c_macros_ref.html#_QklUU19QRVJfTE9OR18w"><span class="b">BITS_PER_LONG</span></a> <span class="f">-</span> <a href="cpu.c_macros_ref.html#_TlJfUEFHRUZMQUdTXzA_"><span class="b">NR_PAGEFLAGS</span></a>
<a name="632" /><span class="False">     632:</span> <span class="f">#</span><span class="n">error</span> <a href="cpu.c_macros_ref.html#_U0VDVElPTlNfV0lEVEhfMA__"><span class="b">SECTIONS_WIDTH</span></a><span class="f">+</span><a href="cpu.c_macros_ref.html#_Tk9ERVNfV0lEVEhfMA__"><span class="b">NODES_WIDTH</span></a><span class="f">+</span><a href="cpu.c_macros_ref.html#_Wk9ORVNfV0lEVEhfMA__"><span class="b">ZONES_WIDTH</span></a> <span class="f">&gt;</span> <a href="cpu.c_macros_ref.html#_QklUU19QRVJfTE9OR18w"><span class="b">BITS_PER_LONG</span></a> <span class="f">-</span> <a href="cpu.c_macros_ref.html#_TlJfUEFHRUZMQUdTXzA_"><span class="b">NR_PAGEFLAGS</span></a>
<a name="633" /><span class="Maybe">     633:</span> <span class="f">#</span><span class="n">endif</span>
<a name="634" /><span class="Maybe">     634:</span> 
<a name="635" /><span class="Maybe">     635:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfTUFTS18w"><span class="b">ZONES_MASK</span></a>        <span class="f">(</span><span class="f">(</span><span class="c">1UL</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfV0lEVEhfMA__"><span class="b">ZONES_WIDTH</span></a><span class="f">)</span> <span class="f">-</span> <span class="c">1</span><span class="f">)</span>
<a name="636" /><span class="Maybe">     636:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfTUFTS18w"><span class="b">NODES_MASK</span></a>        <span class="f">(</span><span class="f">(</span><span class="c">1UL</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfV0lEVEhfMA__"><span class="b">NODES_WIDTH</span></a><span class="f">)</span> <span class="f">-</span> <span class="c">1</span><span class="f">)</span>
<a name="637" /><span class="Maybe">     637:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U0VDVElPTlNfTUFTS18w"><span class="b">SECTIONS_MASK</span></a>        <span class="f">(</span><span class="f">(</span><span class="c">1UL</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_U0VDVElPTlNfV0lEVEhfMA__"><span class="b">SECTIONS_WIDTH</span></a><span class="f">)</span> <span class="f">-</span> <span class="c">1</span><span class="f">)</span>
<a name="638" /><span class="Maybe">     638:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfTUFTS18w"><span class="b">LAST_CPUPID_MASK</span></a>    <span class="f">(</span><span class="f">(</span><span class="c">1UL</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_TEFTVF9DUFVQSURfV0lEVEhfMA__"><span class="b">LAST_CPUPID_WIDTH</span></a><span class="f">)</span> <span class="f">-</span> <span class="c">1</span><span class="f">)</span>
<a name="639" /><span class="Maybe">     639:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Wk9ORUlEX01BU0tfMA__"><span class="b">ZONEID_MASK</span></a>        <span class="f">(</span><span class="f">(</span><span class="c">1UL</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_Wk9ORUlEX1NISUZUXzA_"><span class="b">ZONEID_SHIFT</span></a><span class="f">)</span> <span class="f">-</span> <span class="c">1</span><span class="f">)</span>
<a name="640" /><span class="Maybe">     640:</span> 
<a name="641" /><span class="Maybe">     641:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">enum</span> <span class="b">zone_type</span> <span class="b">page_zonenum</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="642" /><span class="Maybe">     642:</span> <span class="f">{</span>
<a name="643" /><span class="Maybe">     643:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&gt;&gt;</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdTSElGVF8w"><span class="b">ZONES_PGSHIFT</span></a><span class="f">)</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfTUFTS18w"><span class="b">ZONES_MASK</span></a><span class="f">;</span>
<a name="644" /><span class="Maybe">     644:</span> <span class="f">}</span>
<a name="645" /><span class="Maybe">     645:</span> 
<a name="646" /><span class="False">     646:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX1NQQVJTRU1FTV8w"><span class="b">CONFIG_SPARSEMEM</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX1NQQVJTRU1FTV9WTUVNTUFQXzA_"><span class="b">CONFIG_SPARSEMEM_VMEMMAP</span></a><span class="f">)</span>
<a name="647" /><span class="False">     647:</span> <span class="f">#</span><span class="n">define</span> <span class="b">SECTION_IN_PAGE_FLAGS</span>
<a name="648" /><span class="Maybe">     648:</span> <span class="f">#</span><span class="n">endif</span>
<a name="649" /><span class="Maybe">     649:</span> 
<a name="650" /><span class="Maybe">     650:</span> <span class="k">/*</span>
<a name="651" /><span class="Maybe">     651:</span> <span class="k"> * The identification function is mainly used by the buddy allocator for</span>
<a name="652" /><span class="Maybe">     652:</span> <span class="k"> * determining if two pages could be buddies. We are not really identifying</span>
<a name="653" /><span class="Maybe">     653:</span> <span class="k"> * the zone since we could be using the section number id if we do not have</span>
<a name="654" /><span class="Maybe">     654:</span> <span class="k"> * node id available in page flags.</span>
<a name="655" /><span class="Maybe">     655:</span> <span class="k"> * We only guarantee that it will return the same value for two combinable</span>
<a name="656" /><span class="Maybe">     656:</span> <span class="k"> * pages in a zone.</span>
<a name="657" /><span class="Maybe">     657:</span> <span class="k"> */</span>
<a name="658" /><span class="Maybe">     658:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_zone_id</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="659" /><span class="Maybe">     659:</span> <span class="f">{</span>
<a name="660" /><span class="Maybe">     660:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&gt;&gt;</span> <a href="cpu.c_macros_ref.html#_Wk9ORUlEX1BHU0hJRlRfMA__"><span class="b">ZONEID_PGSHIFT</span></a><span class="f">)</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Wk9ORUlEX01BU0tfMA__"><span class="b">ZONEID_MASK</span></a><span class="f">;</span>
<a name="661" /><span class="Maybe">     661:</span> <span class="f">}</span>
<a name="662" /><span class="Maybe">     662:</span> 
<a name="663" /><span class="Maybe">     663:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">zone_to_nid</span><span class="f">(</span><span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">zone</span><span class="f">)</span>
<a name="664" /><span class="Maybe">     664:</span> <span class="f">{</span>
<a name="665" /><span class="Maybe">     665:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX05VTUFfMA__"><span class="b">CONFIG_NUMA</span></a>
<a name="666" /><span class="Maybe">     666:</span>     <span class="m">return</span> <span class="b">zone</span><span class="f">-&gt;</span><span class="b">node</span><span class="f">;</span>
<a name="667" /><span class="False">     667:</span> <span class="f">#</span><span class="n">else</span>
<a name="668" /><span class="False">     668:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="669" /><span class="Maybe">     669:</span> <span class="f">#</span><span class="n">endif</span>
<a name="670" /><span class="Maybe">     670:</span> <span class="f">}</span>
<a name="671" /><span class="Maybe">     671:</span> 
<a name="672" /><span class="Maybe">     672:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Tk9ERV9OT1RfSU5fUEFHRV9GTEFHU18w"><span class="b">NODE_NOT_IN_PAGE_FLAGS</span></a>
<a name="673" /><span class="Maybe">     673:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">page_to_nid</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="674" /><span class="False">     674:</span> <span class="f">#</span><span class="n">else</span>
<a name="675" /><span class="False">     675:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_to_nid</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="676" /><span class="False">     676:</span> <span class="f">{</span>
<a name="677" /><span class="False">     677:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&gt;&gt;</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfUEdTSElGVF8w"><span class="b">NODES_PGSHIFT</span></a><span class="f">)</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfTUFTS18w"><span class="b">NODES_MASK</span></a><span class="f">;</span>
<a name="678" /><span class="False">     678:</span> <span class="f">}</span>
<a name="679" /><span class="Maybe">     679:</span> <span class="f">#</span><span class="n">endif</span>
<a name="680" /><span class="Maybe">     680:</span> 
<a name="681" /><span class="False">     681:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_NUMA_BALANCING</span>
<a name="682" /><span class="False">     682:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">cpu_pid_to_cpupid</span><span class="f">(</span><span class="m">int</span> <span class="b">cpu</span><span class="f">,</span> <span class="m">int</span> <span class="b">pid</span><span class="f">)</span>
<a name="683" /><span class="False">     683:</span> <span class="f">{</span>
<a name="684" /><span class="False">     684:</span>     <span class="m">return</span> <span class="f">(</span><span class="f">(</span><span class="b">cpu</span> <span class="f">&amp;</span> <span class="b">LAST__CPU_MASK</span><span class="f">)</span> <span class="f">&lt;&lt;</span> <span class="b">LAST__PID_SHIFT</span><span class="f">)</span> <span class="f">|</span> <span class="f">(</span><span class="b">pid</span> <span class="f">&amp;</span> <span class="b">LAST__PID_MASK</span><span class="f">)</span><span class="f">;</span>
<a name="685" /><span class="False">     685:</span> <span class="f">}</span>
<a name="686" /><span class="False">     686:</span> 
<a name="687" /><span class="False">     687:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">cpupid_to_pid</span><span class="f">(</span><span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="688" /><span class="False">     688:</span> <span class="f">{</span>
<a name="689" /><span class="False">     689:</span>     <span class="m">return</span> <span class="b">cpupid</span> <span class="f">&amp;</span> <span class="b">LAST__PID_MASK</span><span class="f">;</span>
<a name="690" /><span class="False">     690:</span> <span class="f">}</span>
<a name="691" /><span class="False">     691:</span> 
<a name="692" /><span class="False">     692:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">cpupid_to_cpu</span><span class="f">(</span><span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="693" /><span class="False">     693:</span> <span class="f">{</span>
<a name="694" /><span class="False">     694:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">cpupid</span> <span class="f">&gt;&gt;</span> <span class="b">LAST__PID_SHIFT</span><span class="f">)</span> <span class="f">&amp;</span> <span class="b">LAST__CPU_MASK</span><span class="f">;</span>
<a name="695" /><span class="False">     695:</span> <span class="f">}</span>
<a name="696" /><span class="False">     696:</span> 
<a name="697" /><span class="False">     697:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">cpupid_to_nid</span><span class="f">(</span><span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="698" /><span class="False">     698:</span> <span class="f">{</span>
<a name="699" /><span class="False">     699:</span>     <span class="m">return</span> <span class="b">cpu_to_node</span><span class="f">(</span><span class="b">cpupid_to_cpu</span><span class="f">(</span><span class="b">cpupid</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="700" /><span class="False">     700:</span> <span class="f">}</span>
<a name="701" /><span class="False">     701:</span> 
<a name="702" /><span class="False">     702:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">cpupid_pid_unset</span><span class="f">(</span><span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="703" /><span class="False">     703:</span> <span class="f">{</span>
<a name="704" /><span class="False">     704:</span>     <span class="m">return</span> <span class="b">cpupid_to_pid</span><span class="f">(</span><span class="b">cpupid</span><span class="f">)</span> <span class="f">==</span> <span class="f">(</span><span class="f">-</span><span class="c">1</span> <span class="f">&amp;</span> <span class="b">LAST__PID_MASK</span><span class="f">)</span><span class="f">;</span>
<a name="705" /><span class="False">     705:</span> <span class="f">}</span>
<a name="706" /><span class="False">     706:</span> 
<a name="707" /><span class="False">     707:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">cpupid_cpu_unset</span><span class="f">(</span><span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="708" /><span class="False">     708:</span> <span class="f">{</span>
<a name="709" /><span class="False">     709:</span>     <span class="m">return</span> <span class="b">cpupid_to_cpu</span><span class="f">(</span><span class="b">cpupid</span><span class="f">)</span> <span class="f">==</span> <span class="f">(</span><span class="f">-</span><span class="c">1</span> <span class="f">&amp;</span> <span class="b">LAST__CPU_MASK</span><span class="f">)</span><span class="f">;</span>
<a name="710" /><span class="False">     710:</span> <span class="f">}</span>
<a name="711" /><span class="False">     711:</span> 
<a name="712" /><span class="False">     712:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">__cpupid_match_pid</span><span class="f">(</span><span class="b">pid_t</span> <span class="b">task_pid</span><span class="f">,</span> <span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="713" /><span class="False">     713:</span> <span class="f">{</span>
<a name="714" /><span class="False">     714:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">task_pid</span> <span class="f">&amp;</span> <span class="b">LAST__PID_MASK</span><span class="f">)</span> <span class="f">==</span> <span class="b">cpupid_to_pid</span><span class="f">(</span><span class="b">cpupid</span><span class="f">)</span><span class="f">;</span>
<a name="715" /><span class="False">     715:</span> <span class="f">}</span>
<a name="716" /><span class="False">     716:</span> 
<a name="717" /><span class="False">     717:</span> <span class="f">#</span><span class="n">define</span> <span class="b">cpupid_match_pid</span><span class="f">(</span><span class="b">task</span><span class="f">,</span> <span class="b">cpupid</span><span class="f">)</span> <span class="b">__cpupid_match_pid</span><span class="f">(</span><span class="b">task</span><span class="f">-&gt;</span><span class="b">pid</span><span class="f">,</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="718" /><span class="False">     718:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">LAST_CPUPID_NOT_IN_PAGE_FLAGS</span>
<a name="719" /><span class="False">     719:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_cpupid_xchg_last</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="720" /><span class="False">     720:</span> <span class="f">{</span>
<a name="721" /><span class="False">     721:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_eGNoZ18w"><span class="b">xchg</span></a><span class="f">(</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">_last_cpupid</span><span class="f">,</span> <span class="b">cpupid</span><span class="f">)</span><span class="f">;</span>
<a name="722" /><span class="False">     722:</span> <span class="f">}</span>
<a name="723" /><span class="False">     723:</span> 
<a name="724" /><span class="False">     724:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_cpupid_last</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="725" /><span class="False">     725:</span> <span class="f">{</span>
<a name="726" /><span class="False">     726:</span>     <span class="m">return</span> <span class="b">page</span><span class="f">-&gt;</span><span class="b">_last_cpupid</span><span class="f">;</span>
<a name="727" /><span class="False">     727:</span> <span class="f">}</span>
<a name="728" /><span class="False">     728:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">page_cpupid_reset_last</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="729" /><span class="False">     729:</span> <span class="f">{</span>
<a name="730" /><span class="False">     730:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">_last_cpupid</span> <span class="f">=</span> <span class="f">-</span><span class="c">1</span><span class="f">;</span>
<a name="731" /><span class="False">     731:</span> <span class="f">}</span>
<a name="732" /><span class="False">     732:</span> <span class="f">#</span><span class="n">else</span>
<a name="733" /><span class="False">     733:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_cpupid_last</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="734" /><span class="False">     734:</span> <span class="f">{</span>
<a name="735" /><span class="False">     735:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&gt;&gt;</span> <a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfUEdTSElGVF8w"><span class="b">LAST_CPUPID_PGSHIFT</span></a><span class="f">)</span> <span class="f">&amp;</span> <a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfTUFTS18w"><span class="b">LAST_CPUPID_MASK</span></a><span class="f">;</span>
<a name="736" /><span class="False">     736:</span> <span class="f">}</span>
<a name="737" /><span class="False">     737:</span> 
<a name="738" /><span class="False">     738:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">page_cpupid_xchg_last</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span><span class="f">;</span>
<a name="739" /><span class="False">     739:</span> 
<a name="740" /><span class="False">     740:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">page_cpupid_reset_last</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="741" /><span class="False">     741:</span> <span class="f">{</span>
<a name="742" /><span class="False">     742:</span>     <span class="m">int</span> <span class="b">cpupid</span> <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_TEFTVF9DUFVQSURfU0hJRlRfMA__"><span class="b">LAST_CPUPID_SHIFT</span></a><span class="f">)</span> <span class="f">-</span> <span class="c">1</span><span class="f">;</span>
<a name="743" /><span class="False">     743:</span> 
<a name="744" /><span class="False">     744:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&amp;=</span> <span class="f">~</span><span class="f">(</span><a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfTUFTS18w"><span class="b">LAST_CPUPID_MASK</span></a> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfUEdTSElGVF8w"><span class="b">LAST_CPUPID_PGSHIFT</span></a><span class="f">)</span><span class="f">;</span>
<a name="745" /><span class="False">     745:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">|=</span> <span class="f">(</span><span class="b">cpupid</span> <span class="f">&amp;</span> <a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfTUFTS18w"><span class="b">LAST_CPUPID_MASK</span></a><span class="f">)</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_noref.html#_TEFTVF9DUFVQSURfUEdTSElGVF8w"><span class="b">LAST_CPUPID_PGSHIFT</span></a><span class="f">;</span>
<a name="746" /><span class="False">     746:</span> <span class="f">}</span>
<a name="747" /><span class="False">     747:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* LAST_CPUPID_NOT_IN_PAGE_FLAGS */</span>
<a name="748" /><span class="Maybe">     748:</span> <span class="f">#</span><span class="n">else</span> <span class="k">/* !CONFIG_NUMA_BALANCING */</span>
<a name="749" /><span class="Maybe">     749:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_cpupid_xchg_last</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="750" /><span class="Maybe">     750:</span> <span class="f">{</span>
<a name="751" /><span class="Maybe">     751:</span>     <span class="m">return</span> <span class="b">page_to_nid</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span> <span class="k">/* XXX */</span>
<a name="752" /><span class="Maybe">     752:</span> <span class="f">}</span>
<a name="753" /><span class="Maybe">     753:</span> 
<a name="754" /><span class="Maybe">     754:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_cpupid_last</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="755" /><span class="Maybe">     755:</span> <span class="f">{</span>
<a name="756" /><span class="Maybe">     756:</span>     <span class="m">return</span> <span class="b">page_to_nid</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span> <span class="k">/* XXX */</span>
<a name="757" /><span class="Maybe">     757:</span> <span class="f">}</span>
<a name="758" /><span class="Maybe">     758:</span> 
<a name="759" /><span class="Maybe">     759:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">cpupid_to_nid</span><span class="f">(</span><span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="760" /><span class="Maybe">     760:</span> <span class="f">{</span>
<a name="761" /><span class="Maybe">     761:</span>     <span class="m">return</span> <span class="f">-</span><span class="c">1</span><span class="f">;</span>
<a name="762" /><span class="Maybe">     762:</span> <span class="f">}</span>
<a name="763" /><span class="Maybe">     763:</span> 
<a name="764" /><span class="Maybe">     764:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">cpupid_to_pid</span><span class="f">(</span><span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="765" /><span class="Maybe">     765:</span> <span class="f">{</span>
<a name="766" /><span class="Maybe">     766:</span>     <span class="m">return</span> <span class="f">-</span><span class="c">1</span><span class="f">;</span>
<a name="767" /><span class="Maybe">     767:</span> <span class="f">}</span>
<a name="768" /><span class="Maybe">     768:</span> 
<a name="769" /><span class="Maybe">     769:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">cpupid_to_cpu</span><span class="f">(</span><span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="770" /><span class="Maybe">     770:</span> <span class="f">{</span>
<a name="771" /><span class="Maybe">     771:</span>     <span class="m">return</span> <span class="f">-</span><span class="c">1</span><span class="f">;</span>
<a name="772" /><span class="Maybe">     772:</span> <span class="f">}</span>
<a name="773" /><span class="Maybe">     773:</span> 
<a name="774" /><span class="Maybe">     774:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">cpu_pid_to_cpupid</span><span class="f">(</span><span class="m">int</span> <span class="b">nid</span><span class="f">,</span> <span class="m">int</span> <span class="b">pid</span><span class="f">)</span>
<a name="775" /><span class="Maybe">     775:</span> <span class="f">{</span>
<a name="776" /><span class="Maybe">     776:</span>     <span class="m">return</span> <span class="f">-</span><span class="c">1</span><span class="f">;</span>
<a name="777" /><span class="Maybe">     777:</span> <span class="f">}</span>
<a name="778" /><span class="Maybe">     778:</span> 
<a name="779" /><span class="Maybe">     779:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">cpupid_pid_unset</span><span class="f">(</span><span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="780" /><span class="Maybe">     780:</span> <span class="f">{</span>
<a name="781" /><span class="Maybe">     781:</span>     <span class="m">return</span> <span class="c">1</span><span class="f">;</span>
<a name="782" /><span class="Maybe">     782:</span> <span class="f">}</span>
<a name="783" /><span class="Maybe">     783:</span> 
<a name="784" /><span class="Maybe">     784:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">page_cpupid_reset_last</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="785" /><span class="Maybe">     785:</span> <span class="f">{</span>
<a name="786" /><span class="Maybe">     786:</span> <span class="f">}</span>
<a name="787" /><span class="Maybe">     787:</span> 
<a name="788" /><span class="Maybe">     788:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">cpupid_match_pid</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">task</span><span class="f">,</span> <span class="m">int</span> <span class="b">cpupid</span><span class="f">)</span>
<a name="789" /><span class="Maybe">     789:</span> <span class="f">{</span>
<a name="790" /><span class="Maybe">     790:</span>     <span class="m">return</span> <span class="m">false</span><span class="f">;</span>
<a name="791" /><span class="Maybe">     791:</span> <span class="f">}</span>
<a name="792" /><span class="Maybe">     792:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_NUMA_BALANCING */</span>
<a name="793" /><span class="Maybe">     793:</span> 
<a name="794" /><span class="Maybe">     794:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">page_zone</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="795" /><span class="Maybe">     795:</span> <span class="f">{</span>
<a name="796" /><span class="Maybe">     796:</span>     <span class="m">return</span> <span class="f">&amp;</span><a href="cpu.c_macros_ref.html#_Tk9ERV9EQVRBXzA_"><span class="b">NODE_DATA</span></a><span class="f">(</span><span class="b">page_to_nid</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">node_zones</span><span class="f">[</span><span class="b">page_zonenum</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">]</span><span class="f">;</span>
<a name="797" /><span class="Maybe">     797:</span> <span class="f">}</span>
<a name="798" /><span class="Maybe">     798:</span> 
<a name="799" /><span class="False">     799:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">SECTION_IN_PAGE_FLAGS</span>
<a name="800" /><span class="False">     800:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_page_section</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">section</span><span class="f">)</span>
<a name="801" /><span class="False">     801:</span> <span class="f">{</span>
<a name="802" /><span class="False">     802:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&amp;=</span> <span class="f">~</span><span class="f">(</span><a href="cpu.c_macros_noref.html#_U0VDVElPTlNfTUFTS18w"><span class="b">SECTIONS_MASK</span></a> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_noref.html#_U0VDVElPTlNfUEdTSElGVF8w"><span class="b">SECTIONS_PGSHIFT</span></a><span class="f">)</span><span class="f">;</span>
<a name="803" /><span class="False">     803:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">|=</span> <span class="f">(</span><span class="b">section</span> <span class="f">&amp;</span> <a href="cpu.c_macros_noref.html#_U0VDVElPTlNfTUFTS18w"><span class="b">SECTIONS_MASK</span></a><span class="f">)</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_noref.html#_U0VDVElPTlNfUEdTSElGVF8w"><span class="b">SECTIONS_PGSHIFT</span></a><span class="f">;</span>
<a name="804" /><span class="False">     804:</span> <span class="f">}</span>
<a name="805" /><span class="False">     805:</span> 
<a name="806" /><span class="False">     806:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">page_to_section</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="807" /><span class="False">     807:</span> <span class="f">{</span>
<a name="808" /><span class="False">     808:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&gt;&gt;</span> <a href="cpu.c_macros_noref.html#_U0VDVElPTlNfUEdTSElGVF8w"><span class="b">SECTIONS_PGSHIFT</span></a><span class="f">)</span> <span class="f">&amp;</span> <a href="cpu.c_macros_noref.html#_U0VDVElPTlNfTUFTS18w"><span class="b">SECTIONS_MASK</span></a><span class="f">;</span>
<a name="809" /><span class="False">     809:</span> <span class="f">}</span>
<a name="810" /><span class="Maybe">     810:</span> <span class="f">#</span><span class="n">endif</span>
<a name="811" /><span class="Maybe">     811:</span> 
<a name="812" /><span class="Maybe">     812:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_page_zone</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">enum</span> <span class="b">zone_type</span> <span class="b">zone</span><span class="f">)</span>
<a name="813" /><span class="Maybe">     813:</span> <span class="f">{</span>
<a name="814" /><span class="Maybe">     814:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&amp;=</span> <span class="f">~</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Wk9ORVNfTUFTS18w"><span class="b">ZONES_MASK</span></a> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdTSElGVF8w"><span class="b">ZONES_PGSHIFT</span></a><span class="f">)</span><span class="f">;</span>
<a name="815" /><span class="Maybe">     815:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">|=</span> <span class="f">(</span><span class="b">zone</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfTUFTS18w"><span class="b">ZONES_MASK</span></a><span class="f">)</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_Wk9ORVNfUEdTSElGVF8w"><span class="b">ZONES_PGSHIFT</span></a><span class="f">;</span>
<a name="816" /><span class="Maybe">     816:</span> <span class="f">}</span>
<a name="817" /><span class="Maybe">     817:</span> 
<a name="818" /><span class="Maybe">     818:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_page_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">node</span><span class="f">)</span>
<a name="819" /><span class="Maybe">     819:</span> <span class="f">{</span>
<a name="820" /><span class="Maybe">     820:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&amp;=</span> <span class="f">~</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Tk9ERVNfTUFTS18w"><span class="b">NODES_MASK</span></a> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfUEdTSElGVF8w"><span class="b">NODES_PGSHIFT</span></a><span class="f">)</span><span class="f">;</span>
<a name="821" /><span class="Maybe">     821:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">|=</span> <span class="f">(</span><span class="b">node</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfTUFTS18w"><span class="b">NODES_MASK</span></a><span class="f">)</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_ref.html#_Tk9ERVNfUEdTSElGVF8w"><span class="b">NODES_PGSHIFT</span></a><span class="f">;</span>
<a name="822" /><span class="Maybe">     822:</span> <span class="f">}</span>
<a name="823" /><span class="Maybe">     823:</span> 
<a name="824" /><span class="Maybe">     824:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">set_page_links</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">enum</span> <span class="b">zone_type</span> <span class="b">zone</span><span class="f">,</span>
<a name="825" /><span class="Maybe">     825:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">node</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">)</span>
<a name="826" /><span class="Maybe">     826:</span> <span class="f">{</span>
<a name="827" /><span class="Maybe">     827:</span>     <span class="b">set_page_zone</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">zone</span><span class="f">)</span><span class="f">;</span>
<a name="828" /><span class="Maybe">     828:</span>     <span class="b">set_page_node</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="829" /><span class="False">     829:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">SECTION_IN_PAGE_FLAGS</span>
<a name="830" /><span class="False">     830:</span>     <span class="b">set_page_section</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_cGZuX3RvX3NlY3Rpb25fbnJfMA__"><span class="b">pfn_to_section_nr</span></a><span class="f">(</span><span class="b">pfn</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="831" /><span class="Maybe">     831:</span> <span class="f">#</span><span class="n">endif</span>
<a name="832" /><span class="Maybe">     832:</span> <span class="f">}</span>
<a name="833" /><span class="Maybe">     833:</span> 
<a name="834" /><span class="Maybe">     834:</span> <span class="k">/*</span>
<a name="835" /><span class="Maybe">     835:</span> <span class="k"> * Some inline functions in vmstat.h depend on page_zone()</span>
<a name="836" /><span class="Maybe">     836:</span> <span class="k"> */</span>
<a name="837" /><span class="Maybe">     837:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">vmstat</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="838" /><span class="Maybe">     838:</span> 
<a name="839" /><span class="Maybe">     839:</span> <span class="m">static</span> <a href="cpu.c_macros_ref.html#_X19hbHdheXNfaW5saW5lXzA_"><span class="b">__always_inline</span></a> <span class="m">void</span> <span class="f">*</span><span class="b">lowmem_page_address</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="840" /><span class="Maybe">     840:</span> <span class="f">{</span>
<a name="841" /><span class="Maybe">     841:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_X192YV8w"><span class="b">__va</span></a><span class="f">(</span><a href="cpu.c_macros_ref.html#_UEZOX1BIWVNfMA__"><span class="b">PFN_PHYS</span></a><span class="f">(</span><a href="cpu.c_macros_ref.html#_cGFnZV90b19wZm5fMA__"><span class="b">page_to_pfn</span></a><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="842" /><span class="Maybe">     842:</span> <span class="f">}</span>
<a name="843" /><span class="Maybe">     843:</span> 
<a name="844" /><span class="False">     844:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_HIGHMEM</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">WANT_PAGE_VIRTUAL</span><span class="f">)</span>
<a name="845" /><span class="False">     845:</span> <span class="f">#</span><span class="n">define</span> <span class="b">HASHED_PAGE_VIRTUAL</span>
<a name="846" /><span class="Maybe">     846:</span> <span class="f">#</span><span class="n">endif</span>
<a name="847" /><span class="Maybe">     847:</span> 
<a name="848" /><span class="False">     848:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">WANT_PAGE_VIRTUAL</span><span class="f">)</span>
<a name="849" /><span class="False">     849:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cGFnZV9hZGRyZXNzXzA_"><span class="b">page_address</span></a><span class="f">(</span><span class="b">page</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">-&gt;</span><span class="m">virtual</span><span class="f">)</span>
<a name="850" /><span class="False">     850:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_c2V0X3BhZ2VfYWRkcmVzc18w"><span class="b">set_page_address</span></a><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span>            \
<a name="851" /><span class="False">     851:</span>     <span class="m">do</span> <span class="f">{</span>                        \
<a name="852" /><span class="False">     852:</span>         <span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">-&gt;</span><span class="m">virtual</span> <span class="f">=</span> <span class="f">(</span><span class="b">address</span><span class="f">)</span><span class="f">;</span>        \
<a name="853" /><span class="False">     853:</span>     <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="854" /><span class="False">     854:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cGFnZV9hZGRyZXNzX2luaXRfMA__"><span class="b">page_address_init</span></a><span class="f">(</span><span class="f">)</span>  <span class="m">do</span> <span class="f">{</span> <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="855" /><span class="Maybe">     855:</span> <span class="f">#</span><span class="n">endif</span>
<a name="856" /><span class="Maybe">     856:</span> 
<a name="857" /><span class="False">     857:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">HASHED_PAGE_VIRTUAL</span><span class="f">)</span>
<a name="858" /><span class="False">     858:</span> <span class="m">void</span> <span class="f">*</span><a href="cpu.c_macros_noref.html#_cGFnZV9hZGRyZXNzXzA_"><span class="b">page_address</span></a><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="859" /><span class="False">     859:</span> <span class="m">void</span> <a href="cpu.c_macros_noref.html#_c2V0X3BhZ2VfYWRkcmVzc18w"><span class="b">set_page_address</span></a><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="m">virtual</span><span class="f">)</span><span class="f">;</span>
<a name="860" /><span class="False">     860:</span> <span class="m">void</span> <a href="cpu.c_macros_noref.html#_cGFnZV9hZGRyZXNzX2luaXRfMA__"><span class="b">page_address_init</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="861" /><span class="Maybe">     861:</span> <span class="f">#</span><span class="n">endif</span>
<a name="862" /><span class="Maybe">     862:</span> 
<a name="863" /><span class="Maybe">     863:</span> <span class="f">#</span><span class="n">if</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">HASHED_PAGE_VIRTUAL</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">WANT_PAGE_VIRTUAL</span><span class="f">)</span>
<a name="864" /><span class="Maybe">     864:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cGFnZV9hZGRyZXNzXzA_"><span class="b">page_address</span></a><span class="f">(</span><span class="b">page</span><span class="f">)</span> <span class="b">lowmem_page_address</span><span class="f">(</span><span class="b">page</span><span class="f">)</span>
<a name="865" /><span class="Maybe">     865:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_c2V0X3BhZ2VfYWRkcmVzc18w"><span class="b">set_page_address</span></a><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span>  <span class="m">do</span> <span class="f">{</span> <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="866" /><span class="Maybe">     866:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cGFnZV9hZGRyZXNzX2luaXRfMA__"><span class="b">page_address_init</span></a><span class="f">(</span><span class="f">)</span>  <span class="m">do</span> <span class="f">{</span> <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="867" /><span class="Maybe">     867:</span> <span class="f">#</span><span class="n">endif</span>
<a name="868" /><span class="Maybe">     868:</span> 
<a name="869" /><span class="Maybe">     869:</span> <span class="k">/*</span>
<a name="870" /><span class="Maybe">     870:</span> <span class="k"> * On an anonymous page mapped into a user virtual memory area,</span>
<a name="871" /><span class="Maybe">     871:</span> <span class="k"> * page-&gt;mapping points to its anon_vma, not to a struct address_space;</span>
<a name="872" /><span class="Maybe">     872:</span> <span class="k"> * with the PAGE_MAPPING_ANON bit set to distinguish it.  See rmap.h.</span>
<a name="873" /><span class="Maybe">     873:</span> <span class="k"> *</span>
<a name="874" /><span class="Maybe">     874:</span> <span class="k"> * On an anonymous page in a VM_MERGEABLE area, if CONFIG_KSM is enabled,</span>
<a name="875" /><span class="Maybe">     875:</span> <span class="k"> * the PAGE_MAPPING_KSM bit may be set along with the PAGE_MAPPING_ANON bit;</span>
<a name="876" /><span class="Maybe">     876:</span> <span class="k"> * and then page-&gt;mapping points, not to an anon_vma, but to a private</span>
<a name="877" /><span class="Maybe">     877:</span> <span class="k"> * structure which KSM associates with that merged page.  See ksm.h.</span>
<a name="878" /><span class="Maybe">     878:</span> <span class="k"> *</span>
<a name="879" /><span class="Maybe">     879:</span> <span class="k"> * PAGE_MAPPING_KSM without PAGE_MAPPING_ANON is currently never used.</span>
<a name="880" /><span class="Maybe">     880:</span> <span class="k"> *</span>
<a name="881" /><span class="Maybe">     881:</span> <span class="k"> * Please note that, confusingly, &quot;page_mapping&quot; refers to the inode</span>
<a name="882" /><span class="Maybe">     882:</span> <span class="k"> * address_space which maps the page from disk; whereas &quot;page_mapped&quot;</span>
<a name="883" /><span class="Maybe">     883:</span> <span class="k"> * refers to user virtual address space into which the page is mapped.</span>
<a name="884" /><span class="Maybe">     884:</span> <span class="k"> */</span>
<a name="885" /><span class="Maybe">     885:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_UEFHRV9NQVBQSU5HX0FOT05fMA__"><span class="b">PAGE_MAPPING_ANON</span></a>    <span class="c">1</span>
<a name="886" /><span class="Maybe">     886:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_UEFHRV9NQVBQSU5HX0tTTV8w"><span class="b">PAGE_MAPPING_KSM</span></a>    <span class="c">2</span>
<a name="887" /><span class="Maybe">     887:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_UEFHRV9NQVBQSU5HX0ZMQUdTXzA_"><span class="b">PAGE_MAPPING_FLAGS</span></a>    <span class="f">(</span><a href="cpu.c_macros_ref.html#_UEFHRV9NQVBQSU5HX0FOT05fMA__"><span class="b">PAGE_MAPPING_ANON</span></a> <span class="f">|</span> <a href="cpu.c_macros_ref.html#_UEFHRV9NQVBQSU5HX0tTTV8w"><span class="b">PAGE_MAPPING_KSM</span></a><span class="f">)</span>
<a name="888" /><span class="Maybe">     888:</span> 
<a name="889" /><span class="Maybe">     889:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">page_mapping</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="890" /><span class="Maybe">     890:</span> 
<a name="891" /><span class="Maybe">     891:</span> <span class="k">/* Neutral page-&gt;mapping pointer to address_space or anon_vma or other */</span>
<a name="892" /><span class="Maybe">     892:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="f">*</span><span class="b">page_rmapping</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="893" /><span class="Maybe">     893:</span> <span class="f">{</span>
<a name="894" /><span class="Maybe">     894:</span>     <span class="m">return</span> <span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">(</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">mapping</span> <span class="f">&amp;</span> <span class="f">~</span><a href="cpu.c_macros_ref.html#_UEFHRV9NQVBQSU5HX0ZMQUdTXzA_"><span class="b">PAGE_MAPPING_FLAGS</span></a><span class="f">)</span><span class="f">;</span>
<a name="895" /><span class="Maybe">     895:</span> <span class="f">}</span>
<a name="896" /><span class="Maybe">     896:</span> 
<a name="897" /><span class="Maybe">     897:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">__page_file_mapping</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="898" /><span class="Maybe">     898:</span> 
<a name="899" /><span class="Maybe">     899:</span> <span class="m">static</span> <span class="m">inline</span>
<a name="900" /><span class="Maybe">     900:</span> <span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">page_file_mapping</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="901" /><span class="Maybe">     901:</span> <span class="f">{</span>
<a name="902" /><span class="Maybe">     902:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">PageSwapCache</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="903" /><span class="Maybe">     903:</span>         <span class="m">return</span> <span class="b">__page_file_mapping</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="904" /><span class="Maybe">     904:</span> 
<a name="905" /><span class="Maybe">     905:</span>     <span class="m">return</span> <span class="b">page</span><span class="f">-&gt;</span><span class="b">mapping</span><span class="f">;</span>
<a name="906" /><span class="Maybe">     906:</span> <span class="f">}</span>
<a name="907" /><span class="Maybe">     907:</span> 
<a name="908" /><span class="Maybe">     908:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">PageAnon</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="909" /><span class="Maybe">     909:</span> <span class="f">{</span>
<a name="910" /><span class="Maybe">     910:</span>     <span class="m">return</span> <span class="f">(</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">mapping</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_UEFHRV9NQVBQSU5HX0FOT05fMA__"><span class="b">PAGE_MAPPING_ANON</span></a><span class="f">)</span> <span class="f">!=</span> <span class="c">0</span><span class="f">;</span>
<a name="911" /><span class="Maybe">     911:</span> <span class="f">}</span>
<a name="912" /><span class="Maybe">     912:</span> 
<a name="913" /><span class="Maybe">     913:</span> <span class="k">/*</span>
<a name="914" /><span class="Maybe">     914:</span> <span class="k"> * Return the pagecache index of the passed page.  Regular pagecache pages</span>
<a name="915" /><span class="Maybe">     915:</span> <span class="k"> * use -&gt;index whereas swapcache pages use -&gt;private</span>
<a name="916" /><span class="Maybe">     916:</span> <span class="k"> */</span>
<a name="917" /><span class="Maybe">     917:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">page_index</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="918" /><span class="Maybe">     918:</span> <span class="f">{</span>
<a name="919" /><span class="Maybe">     919:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">PageSwapCache</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="920" /><span class="Maybe">     920:</span>         <span class="m">return</span> <a href="cpu.c_macros_ref.html#_cGFnZV9wcml2YXRlXzA_"><span class="b">page_private</span></a><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="921" /><span class="Maybe">     921:</span>     <span class="m">return</span> <span class="b">page</span><span class="f">-&gt;</span><span class="b">index</span><span class="f">;</span>
<a name="922" /><span class="Maybe">     922:</span> <span class="f">}</span>
<a name="923" /><span class="Maybe">     923:</span> 
<a name="924" /><span class="Maybe">     924:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">__page_file_index</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="925" /><span class="Maybe">     925:</span> 
<a name="926" /><span class="Maybe">     926:</span> <span class="k">/*</span>
<a name="927" /><span class="Maybe">     927:</span> <span class="k"> * Return the file index of the page. Regular pagecache pages use -&gt;index</span>
<a name="928" /><span class="Maybe">     928:</span> <span class="k"> * whereas swapcache pages use swp_offset(-&gt;private)</span>
<a name="929" /><span class="Maybe">     929:</span> <span class="k"> */</span>
<a name="930" /><span class="Maybe">     930:</span> <span class="m">static</span> <span class="m">inline</span> <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">page_file_index</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="931" /><span class="Maybe">     931:</span> <span class="f">{</span>
<a name="932" /><span class="Maybe">     932:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">PageSwapCache</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="933" /><span class="Maybe">     933:</span>         <span class="m">return</span> <span class="b">__page_file_index</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="934" /><span class="Maybe">     934:</span> 
<a name="935" /><span class="Maybe">     935:</span>     <span class="m">return</span> <span class="b">page</span><span class="f">-&gt;</span><span class="b">index</span><span class="f">;</span>
<a name="936" /><span class="Maybe">     936:</span> <span class="f">}</span>
<a name="937" /><span class="Maybe">     937:</span> 
<a name="938" /><span class="Maybe">     938:</span> <span class="k">/*</span>
<a name="939" /><span class="Maybe">     939:</span> <span class="k"> * Return true if this page is mapped into pagetables.</span>
<a name="940" /><span class="Maybe">     940:</span> <span class="k"> */</span>
<a name="941" /><span class="Maybe">     941:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_mapped</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="942" /><span class="Maybe">     942:</span> <span class="f">{</span>
<a name="943" /><span class="Maybe">     943:</span>     <span class="m">return</span> <span class="b">atomic_read</span><span class="f">(</span><span class="f">&amp;</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">_mapcount</span><span class="f">)</span> <span class="f">&gt;=</span> <span class="c">0</span><span class="f">;</span>
<a name="944" /><span class="Maybe">     944:</span> <span class="f">}</span>
<a name="945" /><span class="Maybe">     945:</span> 
<a name="946" /><span class="Maybe">     946:</span> <span class="k">/*</span>
<a name="947" /><span class="Maybe">     947:</span> <span class="k"> * Different kinds of faults, as returned by handle_mm_fault().</span>
<a name="948" /><span class="Maybe">     948:</span> <span class="k"> * Used to decide whether a process gets delivered SIGBUS or</span>
<a name="949" /><span class="Maybe">     949:</span> <span class="k"> * just gets major/minor fault counters bumped up.</span>
<a name="950" /><span class="Maybe">     950:</span> <span class="k"> */</span>
<a name="951" /><span class="Maybe">     951:</span> 
<a name="952" /><span class="Maybe">     952:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfTUlOT1JfMA__"><span class="b">VM_FAULT_MINOR</span></a>    <span class="c">0</span> <span class="k">/* For backwards compat. Remove me quickly. */</span>
<a name="953" /><span class="Maybe">     953:</span> 
<a name="954" /><span class="Maybe">     954:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfT09NXzA_"><span class="b">VM_FAULT_OOM</span></a>    <span class="c">0x0001</span>
<a name="955" /><span class="Maybe">     955:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfU0lHQlVTXzA_"><span class="b">VM_FAULT_SIGBUS</span></a>    <span class="c">0x0002</span>
<a name="956" /><span class="Maybe">     956:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfTUFKT1JfMA__"><span class="b">VM_FAULT_MAJOR</span></a>    <span class="c">0x0004</span>
<a name="957" /><span class="Maybe">     957:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfV1JJVEVfMA__"><span class="b">VM_FAULT_WRITE</span></a>    <span class="c">0x0008</span>    <span class="k">/* Special case for get_user_pages */</span>
<a name="958" /><span class="Maybe">     958:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfSFdQT0lTT05fMA__"><span class="b">VM_FAULT_HWPOISON</span></a> <span class="c">0x0010</span>    <span class="k">/* Hit poisoned small page */</span>
<a name="959" /><span class="Maybe">     959:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfSFdQT0lTT05fTEFSR0VfMA__"><span class="b">VM_FAULT_HWPOISON_LARGE</span></a> <span class="c">0x0020</span>  <span class="k">/* Hit poisoned large page. Index encoded in upper bits */</span>
<a name="960" /><span class="Maybe">     960:</span> 
<a name="961" /><span class="Maybe">     961:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfTk9QQUdFXzA_"><span class="b">VM_FAULT_NOPAGE</span></a>    <span class="c">0x0100</span>    <span class="k">/* -&gt;fault installed the pte, not return page */</span>
<a name="962" /><span class="Maybe">     962:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfTE9DS0VEXzA_"><span class="b">VM_FAULT_LOCKED</span></a>    <span class="c">0x0200</span>    <span class="k">/* -&gt;fault locked the returned page */</span>
<a name="963" /><span class="Maybe">     963:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfUkVUUllfMA__"><span class="b">VM_FAULT_RETRY</span></a>    <span class="c">0x0400</span>    <span class="k">/* -&gt;fault blocked, must retry */</span>
<a name="964" /><span class="Maybe">     964:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfRkFMTEJBQ0tfMA__"><span class="b">VM_FAULT_FALLBACK</span></a> <span class="c">0x0800</span>    <span class="k">/* huge page fault failed, fall back to small */</span>
<a name="965" /><span class="Maybe">     965:</span> 
<a name="966" /><span class="Maybe">     966:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfSFdQT0lTT05fTEFSR0VfTUFTS18w"><span class="b">VM_FAULT_HWPOISON_LARGE_MASK</span></a> <span class="c">0xf000</span> <span class="k">/* encodes hpage index for large hwpoison */</span>
<a name="967" /><span class="Maybe">     967:</span> 
<a name="968" /><span class="Maybe">     968:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfRVJST1JfMA__"><span class="b">VM_FAULT_ERROR</span></a>    <span class="f">(</span><a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfT09NXzA_"><span class="b">VM_FAULT_OOM</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfU0lHQlVTXzA_"><span class="b">VM_FAULT_SIGBUS</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfSFdQT0lTT05fMA__"><span class="b">VM_FAULT_HWPOISON</span></a> <span class="f">|</span> \
<a name="969" /><span class="Maybe">     969:</span>              <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfRkFMTEJBQ0tfMA__"><span class="b">VM_FAULT_FALLBACK</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfSFdQT0lTT05fTEFSR0VfMA__"><span class="b">VM_FAULT_HWPOISON_LARGE</span></a><span class="f">)</span>
<a name="970" /><span class="Maybe">     970:</span> 
<a name="971" /><span class="Maybe">     971:</span> <span class="k">/* Encode hstate index for a hwpoisoned large page */</span>
<a name="972" /><span class="Maybe">     972:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfU0VUX0hJTkRFWF8w"><span class="b">VM_FAULT_SET_HINDEX</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">&lt;&lt;</span> <span class="c">12</span><span class="f">)</span>
<a name="973" /><span class="Maybe">     973:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfR0VUX0hJTkRFWF8w"><span class="b">VM_FAULT_GET_HINDEX</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">&gt;&gt;</span> <span class="c">12</span><span class="f">)</span> <span class="f">&amp;</span> <span class="c">0xf</span><span class="f">)</span>
<a name="974" /><span class="Maybe">     974:</span> 
<a name="975" /><span class="Maybe">     975:</span> <span class="k">/*</span>
<a name="976" /><span class="Maybe">     976:</span> <span class="k"> * Can be called by the pagefault handler when it gets a VM_FAULT_OOM.</span>
<a name="977" /><span class="Maybe">     977:</span> <span class="k"> */</span>
<a name="978" /><span class="Maybe">     978:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">pagefault_out_of_memory</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="979" /><span class="Maybe">     979:</span> 
<a name="980" /><span class="Maybe">     980:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_b2Zmc2V0X2luX3BhZ2VfMA__"><span class="b">offset_in_page</span></a><span class="f">(</span><span class="b">p</span><span class="f">)</span>    <span class="f">(</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="f">(</span><span class="b">p</span><span class="f">)</span> <span class="f">&amp;</span> <span class="f">~</span><a href="cpu.c_macros_ref.html#_UEFHRV9NQVNLXzA_"><span class="b">PAGE_MASK</span></a><span class="f">)</span>
<a name="981" /><span class="Maybe">     981:</span> 
<a name="982" /><span class="Maybe">     982:</span> <span class="k">/*</span>
<a name="983" /><span class="Maybe">     983:</span> <span class="k"> * Flags passed to show_mem() and show_free_areas() to suppress output in</span>
<a name="984" /><span class="Maybe">     984:</span> <span class="k"> * various contexts.</span>
<a name="985" /><span class="Maybe">     985:</span> <span class="k"> */</span>
<a name="986" /><span class="Maybe">     986:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U0hPV19NRU1fRklMVEVSX05PREVTXzA_"><span class="b">SHOW_MEM_FILTER_NODES</span></a>        <span class="f">(</span><span class="c">0x0001u</span><span class="f">)</span>    <span class="k">/* disallowed nodes */</span>
<a name="987" /><span class="Maybe">     987:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U0hPV19NRU1fRklMVEVSX1BBR0VfQ09VTlRfMA__"><span class="b">SHOW_MEM_FILTER_PAGE_COUNT</span></a>    <span class="f">(</span><span class="c">0x0002u</span><span class="f">)</span>    <span class="k">/* page type count */</span>
<a name="988" /><span class="Maybe">     988:</span> 
<a name="989" /><span class="Maybe">     989:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">show_free_areas</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">int</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="990" /><span class="Maybe">     990:</span> <span class="m">extern</span> <span class="m">bool</span> <span class="b">skip_free_areas_node</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">int</span> <span class="b">flags</span><span class="f">,</span> <span class="m">int</span> <span class="b">nid</span><span class="f">)</span><span class="f">;</span>
<a name="991" /><span class="Maybe">     991:</span> 
<a name="992" /><span class="Maybe">     992:</span> <span class="m">int</span> <span class="b">shmem_zero_setup</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="993" /><span class="Maybe">     993:</span> 
<a name="994" /><span class="Maybe">     994:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">can_do_mlock</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="995" /><span class="Maybe">     995:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">user_shm_lock</span><span class="f">(</span><span class="b">size_t</span><span class="f">,</span> <span class="m">struct</span> <span class="b">user_struct</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="996" /><span class="Maybe">     996:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">user_shm_unlock</span><span class="f">(</span><span class="b">size_t</span><span class="f">,</span> <span class="m">struct</span> <span class="b">user_struct</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="997" /><span class="Maybe">     997:</span> 
<a name="998" /><span class="Maybe">     998:</span> <span class="k">/*</span>
<a name="999" /><span class="Maybe">     999:</span> <span class="k"> * Parameter block passed down to zap_pte_range in exceptional cases.</span>
<a name="1000" /><span class="Maybe">    1000:</span> <span class="k"> */</span>
<a name="1001" /><span class="Maybe">    1001:</span> <span class="m">struct</span> <span class="b">zap_details</span> <span class="f">{</span>
<a name="1002" /><span class="Maybe">    1002:</span>     <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">nonlinear_vma</span><span class="f">;</span>    <span class="k">/* Check page-&gt;index if set */</span>
<a name="1003" /><span class="Maybe">    1003:</span>     <span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">check_mapping</span><span class="f">;</span>    <span class="k">/* Check page-&gt;mapping if set */</span>
<a name="1004" /><span class="Maybe">    1004:</span>     <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a>    <span class="b">first_index</span><span class="f">;</span>            <span class="k">/* Lowest page-&gt;index to unmap */</span>
<a name="1005" /><span class="Maybe">    1005:</span>     <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">last_index</span><span class="f">;</span>            <span class="k">/* Highest page-&gt;index to unmap */</span>
<a name="1006" /><span class="Maybe">    1006:</span> <span class="f">}</span><span class="f">;</span>
<a name="1007" /><span class="Maybe">    1007:</span> 
<a name="1008" /><span class="Maybe">    1008:</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">vm_normal_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1009" /><span class="Maybe">    1009:</span>         <span class="b">pte_t</span> <span class="b">pte</span><span class="f">)</span><span class="f">;</span>
<a name="1010" /><span class="Maybe">    1010:</span> 
<a name="1011" /><span class="Maybe">    1011:</span> <span class="m">int</span> <span class="b">zap_vma_ptes</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span>
<a name="1012" /><span class="Maybe">    1012:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">)</span><span class="f">;</span>
<a name="1013" /><span class="Maybe">    1013:</span> <span class="m">void</span> <span class="b">zap_page_range</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span>
<a name="1014" /><span class="Maybe">    1014:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">,</span> <span class="m">struct</span> <span class="b">zap_details</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1015" /><span class="Maybe">    1015:</span> <span class="m">void</span> <span class="b">unmap_vmas</span><span class="f">(</span><span class="m">struct</span> <span class="b">mmu_gather</span> <span class="f">*</span><span class="b">tlb</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">start_vma</span><span class="f">,</span>
<a name="1016" /><span class="Maybe">    1016:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">)</span><span class="f">;</span>
<a name="1017" /><span class="Maybe">    1017:</span> 
<a name="1018" /><span class="Maybe">    1018:</span> <span class="k">/**</span>
<a name="1019" /><span class="Maybe">    1019:</span> <span class="k"> * mm_walk - callbacks for walk_page_range</span>
<a name="1020" /><span class="Maybe">    1020:</span> <span class="k"> * @pgd_entry: if set, called for each non-empty PGD (top-level) entry</span>
<a name="1021" /><span class="Maybe">    1021:</span> <span class="k"> * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry</span>
<a name="1022" /><span class="Maybe">    1022:</span> <span class="k"> * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry</span>
<a name="1023" /><span class="Maybe">    1023:</span> <span class="k"> *           this handler is required to be able to handle</span>
<a name="1024" /><span class="Maybe">    1024:</span> <span class="k"> *           pmd_trans_huge() pmds.  They may simply choose to</span>
<a name="1025" /><span class="Maybe">    1025:</span> <span class="k"> *           split_huge_page() instead of handling it explicitly.</span>
<a name="1026" /><span class="Maybe">    1026:</span> <span class="k"> * @pte_entry: if set, called for each non-empty PTE (4th-level) entry</span>
<a name="1027" /><span class="Maybe">    1027:</span> <span class="k"> * @pte_hole: if set, called for each hole at all levels</span>
<a name="1028" /><span class="Maybe">    1028:</span> <span class="k"> * @hugetlb_entry: if set, called for each hugetlb entry</span>
<a name="1029" /><span class="Maybe">    1029:</span> <span class="k"> *           *Caution*: The caller must hold mmap_sem() if @hugetlb_entry</span>
<a name="1030" /><span class="Maybe">    1030:</span> <span class="k"> *                   is used.</span>
<a name="1031" /><span class="Maybe">    1031:</span> <span class="k"> *</span>
<a name="1032" /><span class="Maybe">    1032:</span> <span class="k"> * (see walk_page_range for more details)</span>
<a name="1033" /><span class="Maybe">    1033:</span> <span class="k"> */</span>
<a name="1034" /><span class="Maybe">    1034:</span> <span class="m">struct</span> <span class="b">mm_walk</span> <span class="f">{</span>
<a name="1035" /><span class="Maybe">    1035:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">pgd_entry</span><span class="f">)</span><span class="f">(</span><span class="b">pgd_t</span> <span class="f">*</span><span class="b">pgd</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1036" /><span class="Maybe">    1036:</span>              <span class="m">unsigned</span> <span class="m">long</span> <span class="b">next</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_walk</span> <span class="f">*</span><span class="b">walk</span><span class="f">)</span><span class="f">;</span>
<a name="1037" /><span class="Maybe">    1037:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">pud_entry</span><span class="f">)</span><span class="f">(</span><span class="b">pud_t</span> <span class="f">*</span><span class="b">pud</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1038" /><span class="Maybe">    1038:</span>                      <span class="m">unsigned</span> <span class="m">long</span> <span class="b">next</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_walk</span> <span class="f">*</span><span class="b">walk</span><span class="f">)</span><span class="f">;</span>
<a name="1039" /><span class="Maybe">    1039:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">pmd_entry</span><span class="f">)</span><span class="f">(</span><span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1040" /><span class="Maybe">    1040:</span>              <span class="m">unsigned</span> <span class="m">long</span> <span class="b">next</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_walk</span> <span class="f">*</span><span class="b">walk</span><span class="f">)</span><span class="f">;</span>
<a name="1041" /><span class="Maybe">    1041:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">pte_entry</span><span class="f">)</span><span class="f">(</span><span class="b">pte_t</span> <span class="f">*</span><span class="b">pte</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1042" /><span class="Maybe">    1042:</span>              <span class="m">unsigned</span> <span class="m">long</span> <span class="b">next</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_walk</span> <span class="f">*</span><span class="b">walk</span><span class="f">)</span><span class="f">;</span>
<a name="1043" /><span class="Maybe">    1043:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">pte_hole</span><span class="f">)</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">next</span><span class="f">,</span>
<a name="1044" /><span class="Maybe">    1044:</span>             <span class="m">struct</span> <span class="b">mm_walk</span> <span class="f">*</span><span class="b">walk</span><span class="f">)</span><span class="f">;</span>
<a name="1045" /><span class="Maybe">    1045:</span>     <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">hugetlb_entry</span><span class="f">)</span><span class="f">(</span><span class="b">pte_t</span> <span class="f">*</span><span class="b">pte</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">hmask</span><span class="f">,</span>
<a name="1046" /><span class="Maybe">    1046:</span>                  <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">next</span><span class="f">,</span>
<a name="1047" /><span class="Maybe">    1047:</span>                  <span class="m">struct</span> <span class="b">mm_walk</span> <span class="f">*</span><span class="b">walk</span><span class="f">)</span><span class="f">;</span>
<a name="1048" /><span class="Maybe">    1048:</span>     <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">;</span>
<a name="1049" /><span class="Maybe">    1049:</span>     <span class="m">void</span> <span class="f">*</span><span class="m">private</span><span class="f">;</span>
<a name="1050" /><span class="Maybe">    1050:</span> <span class="f">}</span><span class="f">;</span>
<a name="1051" /><span class="Maybe">    1051:</span> 
<a name="1052" /><span class="Maybe">    1052:</span> <span class="m">int</span> <span class="b">walk_page_range</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">,</span>
<a name="1053" /><span class="Maybe">    1053:</span>         <span class="m">struct</span> <span class="b">mm_walk</span> <span class="f">*</span><span class="b">walk</span><span class="f">)</span><span class="f">;</span>
<a name="1054" /><span class="Maybe">    1054:</span> <span class="m">void</span> <span class="b">free_pgd_range</span><span class="f">(</span><span class="m">struct</span> <span class="b">mmu_gather</span> <span class="f">*</span><span class="b">tlb</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1055" /><span class="Maybe">    1055:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">floor</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">ceiling</span><span class="f">)</span><span class="f">;</span>
<a name="1056" /><span class="Maybe">    1056:</span> <span class="m">int</span> <span class="b">copy_page_range</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">dst</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">src</span><span class="f">,</span>
<a name="1057" /><span class="Maybe">    1057:</span>             <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">)</span><span class="f">;</span>
<a name="1058" /><span class="Maybe">    1058:</span> <span class="m">void</span> <span class="b">unmap_mapping_range</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">,</span>
<a name="1059" /><span class="Maybe">    1059:</span>         <span class="b">loff_t</span> <span class="m">const</span> <span class="b">holebegin</span><span class="f">,</span> <span class="b">loff_t</span> <span class="m">const</span> <span class="b">holelen</span><span class="f">,</span> <span class="m">int</span> <span class="b">even_cows</span><span class="f">)</span><span class="f">;</span>
<a name="1060" /><span class="Maybe">    1060:</span> <span class="m">int</span> <span class="b">follow_pfn</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span>
<a name="1061" /><span class="Maybe">    1061:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1062" /><span class="Maybe">    1062:</span> <span class="m">int</span> <span class="b">follow_phys</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span>
<a name="1063" /><span class="Maybe">    1063:</span>         <span class="m">unsigned</span> <span class="m">int</span> <span class="b">flags</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">prot</span><span class="f">,</span> <span class="b">resource_size_t</span> <span class="f">*</span><span class="b">phys</span><span class="f">)</span><span class="f">;</span>
<a name="1064" /><span class="Maybe">    1064:</span> <span class="m">int</span> <span class="b">generic_access_phys</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1065" /><span class="Maybe">    1065:</span>             <span class="m">void</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="m">int</span> <span class="b">len</span><span class="f">,</span> <span class="m">int</span> <span class="b">write</span><span class="f">)</span><span class="f">;</span>
<a name="1066" /><span class="Maybe">    1066:</span> 
<a name="1067" /><span class="Maybe">    1067:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">unmap_shared_mapping_range</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">,</span>
<a name="1068" /><span class="Maybe">    1068:</span>         <span class="b">loff_t</span> <span class="m">const</span> <span class="b">holebegin</span><span class="f">,</span> <span class="b">loff_t</span> <span class="m">const</span> <span class="b">holelen</span><span class="f">)</span>
<a name="1069" /><span class="Maybe">    1069:</span> <span class="f">{</span>
<a name="1070" /><span class="Maybe">    1070:</span>     <span class="b">unmap_mapping_range</span><span class="f">(</span><span class="b">mapping</span><span class="f">,</span> <span class="b">holebegin</span><span class="f">,</span> <span class="b">holelen</span><span class="f">,</span> <span class="c">0</span><span class="f">)</span><span class="f">;</span>
<a name="1071" /><span class="Maybe">    1071:</span> <span class="f">}</span>
<a name="1072" /><span class="Maybe">    1072:</span> 
<a name="1073" /><span class="Maybe">    1073:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">truncate_pagecache</span><span class="f">(</span><span class="m">struct</span> <span class="b">inode</span> <span class="f">*</span><span class="b">inode</span><span class="f">,</span> <span class="b">loff_t</span> <span class="m">new</span><span class="f">)</span><span class="f">;</span>
<a name="1074" /><span class="Maybe">    1074:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">truncate_setsize</span><span class="f">(</span><span class="m">struct</span> <span class="b">inode</span> <span class="f">*</span><span class="b">inode</span><span class="f">,</span> <span class="b">loff_t</span> <span class="b">newsize</span><span class="f">)</span><span class="f">;</span>
<a name="1075" /><span class="Maybe">    1075:</span> <span class="m">void</span> <span class="b">truncate_pagecache_range</span><span class="f">(</span><span class="m">struct</span> <span class="b">inode</span> <span class="f">*</span><span class="b">inode</span><span class="f">,</span> <span class="b">loff_t</span> <span class="b">offset</span><span class="f">,</span> <span class="b">loff_t</span> <span class="b">end</span><span class="f">)</span><span class="f">;</span>
<a name="1076" /><span class="Maybe">    1076:</span> <span class="m">int</span> <span class="b">truncate_inode_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1077" /><span class="Maybe">    1077:</span> <span class="m">int</span> <span class="b">generic_error_remove_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1078" /><span class="Maybe">    1078:</span> <span class="m">int</span> <span class="b">invalidate_inode_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1079" /><span class="Maybe">    1079:</span> 
<a name="1080" /><span class="Maybe">    1080:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a>
<a name="1081" /><span class="Maybe">    1081:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">handle_mm_fault</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1082" /><span class="Maybe">    1082:</span>             <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="1083" /><span class="Maybe">    1083:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">fixup_user_fault</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">tsk</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="1084" /><span class="Maybe">    1084:</span>                 <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">fault_flags</span><span class="f">)</span><span class="f">;</span>
<a name="1085" /><span class="False">    1085:</span> <span class="f">#</span><span class="n">else</span>
<a name="1086" /><span class="False">    1086:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">handle_mm_fault</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="1087" /><span class="False">    1087:</span>             <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span>
<a name="1088" /><span class="False">    1088:</span>             <span class="m">unsigned</span> <span class="m">int</span> <span class="b">flags</span><span class="f">)</span>
<a name="1089" /><span class="False">    1089:</span> <span class="f">{</span>
<a name="1090" /><span class="False">    1090:</span>     <span class="k">/* should never happen if there&apos;s no MMU */</span>
<a name="1091" /><span class="False">    1091:</span>     <a href="cpu.c_macros_ref.html#_QlVHXzA_"><span class="b">BUG</span></a><span class="f">(</span><span class="f">)</span><span class="f">;</span>
<a name="1092" /><span class="False">    1092:</span>     <span class="m">return</span> <a href="cpu.c_macros_noref.html#_Vk1fRkFVTFRfU0lHQlVTXzA_"><span class="b">VM_FAULT_SIGBUS</span></a><span class="f">;</span>
<a name="1093" /><span class="False">    1093:</span> <span class="f">}</span>
<a name="1094" /><span class="False">    1094:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">fixup_user_fault</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">tsk</span><span class="f">,</span>
<a name="1095" /><span class="False">    1095:</span>         <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span>
<a name="1096" /><span class="False">    1096:</span>         <span class="m">unsigned</span> <span class="m">int</span> <span class="b">fault_flags</span><span class="f">)</span>
<a name="1097" /><span class="False">    1097:</span> <span class="f">{</span>
<a name="1098" /><span class="False">    1098:</span>     <span class="k">/* should never happen if there&apos;s no MMU */</span>
<a name="1099" /><span class="False">    1099:</span>     <a href="cpu.c_macros_ref.html#_QlVHXzA_"><span class="b">BUG</span></a><span class="f">(</span><span class="f">)</span><span class="f">;</span>
<a name="1100" /><span class="False">    1100:</span>     <span class="m">return</span> <span class="f">-</span><a href="cpu.c_macros_noref.html#_RUZBVUxUXzA_"><span class="b">EFAULT</span></a><span class="f">;</span>
<a name="1101" /><span class="False">    1101:</span> <span class="f">}</span>
<a name="1102" /><span class="Maybe">    1102:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1103" /><span class="Maybe">    1103:</span> 
<a name="1104" /><span class="Maybe">    1104:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">access_process_vm</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">tsk</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="m">int</span> <span class="b">len</span><span class="f">,</span> <span class="m">int</span> <span class="b">write</span><span class="f">)</span><span class="f">;</span>
<a name="1105" /><span class="Maybe">    1105:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">access_remote_vm</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1106" /><span class="Maybe">    1106:</span>         <span class="m">void</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="m">int</span> <span class="b">len</span><span class="f">,</span> <span class="m">int</span> <span class="b">write</span><span class="f">)</span><span class="f">;</span>
<a name="1107" /><span class="Maybe">    1107:</span> 
<a name="1108" /><span class="Maybe">    1108:</span> <span class="m">long</span> <span class="b">__get_user_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">tsk</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="1109" /><span class="Maybe">    1109:</span>               <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr_pages</span><span class="f">,</span>
<a name="1110" /><span class="Maybe">    1110:</span>               <span class="m">unsigned</span> <span class="m">int</span> <span class="b">foll_flags</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="b">pages</span><span class="f">,</span>
<a name="1111" /><span class="Maybe">    1111:</span>               <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">*</span><span class="b">vmas</span><span class="f">,</span> <span class="m">int</span> <span class="f">*</span><span class="b">nonblocking</span><span class="f">)</span><span class="f">;</span>
<a name="1112" /><span class="Maybe">    1112:</span> <span class="m">long</span> <span class="b">get_user_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">tsk</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="1113" /><span class="Maybe">    1113:</span>             <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr_pages</span><span class="f">,</span>
<a name="1114" /><span class="Maybe">    1114:</span>             <span class="m">int</span> <span class="b">write</span><span class="f">,</span> <span class="m">int</span> <span class="b">force</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="b">pages</span><span class="f">,</span>
<a name="1115" /><span class="Maybe">    1115:</span>             <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">*</span><span class="b">vmas</span><span class="f">)</span><span class="f">;</span>
<a name="1116" /><span class="Maybe">    1116:</span> <span class="m">int</span> <span class="b">get_user_pages_fast</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">int</span> <span class="b">nr_pages</span><span class="f">,</span> <span class="m">int</span> <span class="b">write</span><span class="f">,</span>
<a name="1117" /><span class="Maybe">    1117:</span>             <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="b">pages</span><span class="f">)</span><span class="f">;</span>
<a name="1118" /><span class="Maybe">    1118:</span> <span class="m">struct</span> <span class="b">kvec</span><span class="f">;</span>
<a name="1119" /><span class="Maybe">    1119:</span> <span class="m">int</span> <span class="b">get_kernel_pages</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">kvec</span> <span class="f">*</span><span class="b">iov</span><span class="f">,</span> <span class="m">int</span> <span class="b">nr_pages</span><span class="f">,</span> <span class="m">int</span> <span class="b">write</span><span class="f">,</span>
<a name="1120" /><span class="Maybe">    1120:</span>             <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="b">pages</span><span class="f">)</span><span class="f">;</span>
<a name="1121" /><span class="Maybe">    1121:</span> <span class="m">int</span> <span class="b">get_kernel_page</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">int</span> <span class="b">write</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="b">pages</span><span class="f">)</span><span class="f">;</span>
<a name="1122" /><span class="Maybe">    1122:</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">get_dump_page</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="1123" /><span class="Maybe">    1123:</span> 
<a name="1124" /><span class="Maybe">    1124:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">try_to_release_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span> <span class="b">page</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">)</span><span class="f">;</span>
<a name="1125" /><span class="Maybe">    1125:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">do_invalidatepage</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">offset</span><span class="f">,</span>
<a name="1126" /><span class="Maybe">    1126:</span>                   <span class="m">unsigned</span> <span class="m">int</span> <span class="b">length</span><span class="f">)</span><span class="f">;</span>
<a name="1127" /><span class="Maybe">    1127:</span> 
<a name="1128" /><span class="Maybe">    1128:</span> <span class="m">int</span> <span class="b">__set_page_dirty_nobuffers</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1129" /><span class="Maybe">    1129:</span> <span class="m">int</span> <span class="b">__set_page_dirty_no_writeback</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1130" /><span class="Maybe">    1130:</span> <span class="m">int</span> <span class="b">redirty_page_for_writepage</span><span class="f">(</span><span class="m">struct</span> <span class="b">writeback_control</span> <span class="f">*</span><span class="b">wbc</span><span class="f">,</span>
<a name="1131" /><span class="Maybe">    1131:</span>                 <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1132" /><span class="Maybe">    1132:</span> <span class="m">void</span> <span class="b">account_page_dirtied</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">)</span><span class="f">;</span>
<a name="1133" /><span class="Maybe">    1133:</span> <span class="m">void</span> <span class="b">account_page_writeback</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1134" /><span class="Maybe">    1134:</span> <span class="m">int</span> <span class="b">set_page_dirty</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1135" /><span class="Maybe">    1135:</span> <span class="m">int</span> <span class="b">set_page_dirty_lock</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1136" /><span class="Maybe">    1136:</span> <span class="m">int</span> <span class="b">clear_page_dirty_for_io</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1137" /><span class="Maybe">    1137:</span> 
<a name="1138" /><span class="Maybe">    1138:</span> <span class="k">/* Is the vma a continuation of the stack vma above it? */</span>
<a name="1139" /><span class="Maybe">    1139:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">vma_growsdown</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span>
<a name="1140" /><span class="Maybe">    1140:</span> <span class="f">{</span>
<a name="1141" /><span class="Maybe">    1141:</span>     <span class="m">return</span> <span class="b">vma</span> <span class="f">&amp;&amp;</span> <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_end</span> <span class="f">==</span> <span class="b">addr</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NET1dOXzA_"><span class="b">VM_GROWSDOWN</span></a><span class="f">)</span><span class="f">;</span>
<a name="1142" /><span class="Maybe">    1142:</span> <span class="f">}</span>
<a name="1143" /><span class="Maybe">    1143:</span> 
<a name="1144" /><span class="Maybe">    1144:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">stack_guard_page_start</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1145" /><span class="Maybe">    1145:</span>                          <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span>
<a name="1146" /><span class="Maybe">    1146:</span> <span class="f">{</span>
<a name="1147" /><span class="Maybe">    1147:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NET1dOXzA_"><span class="b">VM_GROWSDOWN</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span>
<a name="1148" /><span class="Maybe">    1148:</span>         <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_start</span> <span class="f">==</span> <span class="b">addr</span><span class="f">)</span> <span class="f">&amp;&amp;</span>
<a name="1149" /><span class="Maybe">    1149:</span>         <span class="f">!</span><span class="b">vma_growsdown</span><span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_prev</span><span class="f">,</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="1150" /><span class="Maybe">    1150:</span> <span class="f">}</span>
<a name="1151" /><span class="Maybe">    1151:</span> 
<a name="1152" /><span class="Maybe">    1152:</span> <span class="k">/* Is the vma a continuation of the stack vma below it? */</span>
<a name="1153" /><span class="Maybe">    1153:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">vma_growsup</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span>
<a name="1154" /><span class="Maybe">    1154:</span> <span class="f">{</span>
<a name="1155" /><span class="Maybe">    1155:</span>     <span class="m">return</span> <span class="b">vma</span> <span class="f">&amp;&amp;</span> <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_start</span> <span class="f">==</span> <span class="b">addr</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NVUF8w"><span class="b">VM_GROWSUP</span></a><span class="f">)</span><span class="f">;</span>
<a name="1156" /><span class="Maybe">    1156:</span> <span class="f">}</span>
<a name="1157" /><span class="Maybe">    1157:</span> 
<a name="1158" /><span class="Maybe">    1158:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">stack_guard_page_end</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1159" /><span class="Maybe">    1159:</span>                        <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span>
<a name="1160" /><span class="Maybe">    1160:</span> <span class="f">{</span>
<a name="1161" /><span class="Maybe">    1161:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NVUF8w"><span class="b">VM_GROWSUP</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span>
<a name="1162" /><span class="Maybe">    1162:</span>         <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_end</span> <span class="f">==</span> <span class="b">addr</span><span class="f">)</span> <span class="f">&amp;&amp;</span>
<a name="1163" /><span class="Maybe">    1163:</span>         <span class="f">!</span><span class="b">vma_growsup</span><span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_next</span><span class="f">,</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="1164" /><span class="Maybe">    1164:</span> <span class="f">}</span>
<a name="1165" /><span class="Maybe">    1165:</span> 
<a name="1166" /><span class="Maybe">    1166:</span> <span class="m">extern</span> <span class="b">pid_t</span>
<a name="1167" /><span class="Maybe">    1167:</span> <span class="b">vm_is_stack</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">task</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">int</span> <span class="b">in_group</span><span class="f">)</span><span class="f">;</span>
<a name="1168" /><span class="Maybe">    1168:</span> 
<a name="1169" /><span class="Maybe">    1169:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">move_page_tables</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1170" /><span class="Maybe">    1170:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">old_addr</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">new_vma</span><span class="f">,</span>
<a name="1171" /><span class="Maybe">    1171:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">new_addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">len</span><span class="f">,</span>
<a name="1172" /><span class="Maybe">    1172:</span>         <span class="m">bool</span> <span class="b">need_rmap_locks</span><span class="f">)</span><span class="f">;</span>
<a name="1173" /><span class="Maybe">    1173:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">change_protection</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span>
<a name="1174" /><span class="Maybe">    1174:</span>                   <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">,</span> <span class="b">pgprot_t</span> <span class="b">newprot</span><span class="f">,</span>
<a name="1175" /><span class="Maybe">    1175:</span>                   <span class="m">int</span> <span class="b">dirty_accountable</span><span class="f">,</span> <span class="m">int</span> <span class="b">prot_numa</span><span class="f">)</span><span class="f">;</span>
<a name="1176" /><span class="Maybe">    1176:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">mprotect_fixup</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1177" /><span class="Maybe">    1177:</span>               <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">*</span><span class="b">pprev</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span>
<a name="1178" /><span class="Maybe">    1178:</span>               <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">newflags</span><span class="f">)</span><span class="f">;</span>
<a name="1179" /><span class="Maybe">    1179:</span> 
<a name="1180" /><span class="Maybe">    1180:</span> <span class="k">/*</span>
<a name="1181" /><span class="Maybe">    1181:</span> <span class="k"> * doesn&apos;t attempt to fault and will return short.</span>
<a name="1182" /><span class="Maybe">    1182:</span> <span class="k"> */</span>
<a name="1183" /><span class="Maybe">    1183:</span> <span class="m">int</span> <span class="b">__get_user_pages_fast</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">int</span> <span class="b">nr_pages</span><span class="f">,</span> <span class="m">int</span> <span class="b">write</span><span class="f">,</span>
<a name="1184" /><span class="Maybe">    1184:</span>               <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="b">pages</span><span class="f">)</span><span class="f">;</span>
<a name="1185" /><span class="Maybe">    1185:</span> <span class="k">/*</span>
<a name="1186" /><span class="Maybe">    1186:</span> <span class="k"> * per-process(per-mm_struct) statistics.</span>
<a name="1187" /><span class="Maybe">    1187:</span> <span class="k"> */</span>
<a name="1188" /><span class="Maybe">    1188:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">get_mm_counter</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">int</span> <span class="b">member</span><span class="f">)</span>
<a name="1189" /><span class="Maybe">    1189:</span> <span class="f">{</span>
<a name="1190" /><span class="Maybe">    1190:</span>     <span class="m">long</span> <span class="b">val</span> <span class="f">=</span> <span class="b">atomic_long_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">rss_stat</span><span class="f">.</span><span class="b">count</span><span class="f">[</span><span class="b">member</span><span class="f">]</span><span class="f">)</span><span class="f">;</span>
<a name="1191" /><span class="Maybe">    1191:</span> 
<a name="1192" /><span class="Maybe">    1192:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_U1BMSVRfUlNTX0NPVU5USU5HXzA_"><span class="b">SPLIT_RSS_COUNTING</span></a>
<a name="1193" /><span class="Maybe">    1193:</span>     <span class="k">/*</span>
<a name="1194" /><span class="Maybe">    1194:</span> <span class="k">     * counter is updated in asynchronous manner and may go to minus.</span>
<a name="1195" /><span class="Maybe">    1195:</span> <span class="k">     * But it&apos;s never be expected number for users.</span>
<a name="1196" /><span class="Maybe">    1196:</span> <span class="k">     */</span>
<a name="1197" /><span class="Maybe">    1197:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">val</span> <span class="f">&lt;</span> <span class="c">0</span><span class="f">)</span>
<a name="1198" /><span class="Maybe">    1198:</span>         <span class="b">val</span> <span class="f">=</span> <span class="c">0</span><span class="f">;</span>
<a name="1199" /><span class="Maybe">    1199:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1200" /><span class="Maybe">    1200:</span>     <span class="m">return</span> <span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="b">val</span><span class="f">;</span>
<a name="1201" /><span class="Maybe">    1201:</span> <span class="f">}</span>
<a name="1202" /><span class="Maybe">    1202:</span> 
<a name="1203" /><span class="Maybe">    1203:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">add_mm_counter</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">int</span> <span class="b">member</span><span class="f">,</span> <span class="m">long</span> <span class="b">value</span><span class="f">)</span>
<a name="1204" /><span class="Maybe">    1204:</span> <span class="f">{</span>
<a name="1205" /><span class="Maybe">    1205:</span>     <span class="b">atomic_long_add</span><span class="f">(</span><span class="b">value</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">rss_stat</span><span class="f">.</span><span class="b">count</span><span class="f">[</span><span class="b">member</span><span class="f">]</span><span class="f">)</span><span class="f">;</span>
<a name="1206" /><span class="Maybe">    1206:</span> <span class="f">}</span>
<a name="1207" /><span class="Maybe">    1207:</span> 
<a name="1208" /><span class="Maybe">    1208:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">inc_mm_counter</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">int</span> <span class="b">member</span><span class="f">)</span>
<a name="1209" /><span class="Maybe">    1209:</span> <span class="f">{</span>
<a name="1210" /><span class="Maybe">    1210:</span>     <span class="b">atomic_long_inc</span><span class="f">(</span><span class="f">&amp;</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">rss_stat</span><span class="f">.</span><span class="b">count</span><span class="f">[</span><span class="b">member</span><span class="f">]</span><span class="f">)</span><span class="f">;</span>
<a name="1211" /><span class="Maybe">    1211:</span> <span class="f">}</span>
<a name="1212" /><span class="Maybe">    1212:</span> 
<a name="1213" /><span class="Maybe">    1213:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">dec_mm_counter</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">int</span> <span class="b">member</span><span class="f">)</span>
<a name="1214" /><span class="Maybe">    1214:</span> <span class="f">{</span>
<a name="1215" /><span class="Maybe">    1215:</span>     <span class="b">atomic_long_dec</span><span class="f">(</span><span class="f">&amp;</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">rss_stat</span><span class="f">.</span><span class="b">count</span><span class="f">[</span><span class="b">member</span><span class="f">]</span><span class="f">)</span><span class="f">;</span>
<a name="1216" /><span class="Maybe">    1216:</span> <span class="f">}</span>
<a name="1217" /><span class="Maybe">    1217:</span> 
<a name="1218" /><span class="Maybe">    1218:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">get_mm_rss</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span>
<a name="1219" /><span class="Maybe">    1219:</span> <span class="f">{</span>
<a name="1220" /><span class="Maybe">    1220:</span>     <span class="m">return</span> <span class="b">get_mm_counter</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">MM_FILEPAGES</span><span class="f">)</span> <span class="f">+</span>
<a name="1221" /><span class="Maybe">    1221:</span>         <span class="b">get_mm_counter</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">MM_ANONPAGES</span><span class="f">)</span><span class="f">;</span>
<a name="1222" /><span class="Maybe">    1222:</span> <span class="f">}</span>
<a name="1223" /><span class="Maybe">    1223:</span> 
<a name="1224" /><span class="Maybe">    1224:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">get_mm_hiwater_rss</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span>
<a name="1225" /><span class="Maybe">    1225:</span> <span class="f">{</span>
<a name="1226" /><span class="Maybe">    1226:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_bWF4XzA_"><span class="b">max</span></a><span class="f">(</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">hiwater_rss</span><span class="f">,</span> <span class="b">get_mm_rss</span><span class="f">(</span><span class="b">mm</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="1227" /><span class="Maybe">    1227:</span> <span class="f">}</span>
<a name="1228" /><span class="Maybe">    1228:</span> 
<a name="1229" /><span class="Maybe">    1229:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">get_mm_hiwater_vm</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span>
<a name="1230" /><span class="Maybe">    1230:</span> <span class="f">{</span>
<a name="1231" /><span class="Maybe">    1231:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_bWF4XzA_"><span class="b">max</span></a><span class="f">(</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">hiwater_vm</span><span class="f">,</span> <span class="b">mm</span><span class="f">-&gt;</span><span class="b">total_vm</span><span class="f">)</span><span class="f">;</span>
<a name="1232" /><span class="Maybe">    1232:</span> <span class="f">}</span>
<a name="1233" /><span class="Maybe">    1233:</span> 
<a name="1234" /><span class="Maybe">    1234:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">update_hiwater_rss</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span>
<a name="1235" /><span class="Maybe">    1235:</span> <span class="f">{</span>
<a name="1236" /><span class="Maybe">    1236:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">_rss</span> <span class="f">=</span> <span class="b">get_mm_rss</span><span class="f">(</span><span class="b">mm</span><span class="f">)</span><span class="f">;</span>
<a name="1237" /><span class="Maybe">    1237:</span> 
<a name="1238" /><span class="Maybe">    1238:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">(</span><span class="b">mm</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">hiwater_rss</span> <span class="f">&lt;</span> <span class="b">_rss</span><span class="f">)</span>
<a name="1239" /><span class="Maybe">    1239:</span>         <span class="f">(</span><span class="b">mm</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">hiwater_rss</span> <span class="f">=</span> <span class="b">_rss</span><span class="f">;</span>
<a name="1240" /><span class="Maybe">    1240:</span> <span class="f">}</span>
<a name="1241" /><span class="Maybe">    1241:</span> 
<a name="1242" /><span class="Maybe">    1242:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">update_hiwater_vm</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span>
<a name="1243" /><span class="Maybe">    1243:</span> <span class="f">{</span>
<a name="1244" /><span class="Maybe">    1244:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">hiwater_vm</span> <span class="f">&lt;</span> <span class="b">mm</span><span class="f">-&gt;</span><span class="b">total_vm</span><span class="f">)</span>
<a name="1245" /><span class="Maybe">    1245:</span>         <span class="b">mm</span><span class="f">-&gt;</span><span class="b">hiwater_vm</span> <span class="f">=</span> <span class="b">mm</span><span class="f">-&gt;</span><span class="b">total_vm</span><span class="f">;</span>
<a name="1246" /><span class="Maybe">    1246:</span> <span class="f">}</span>
<a name="1247" /><span class="Maybe">    1247:</span> 
<a name="1248" /><span class="Maybe">    1248:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">setmax_mm_hiwater_rss</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">maxrss</span><span class="f">,</span>
<a name="1249" /><span class="Maybe">    1249:</span>                      <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span>
<a name="1250" /><span class="Maybe">    1250:</span> <span class="f">{</span>
<a name="1251" /><span class="Maybe">    1251:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">hiwater_rss</span> <span class="f">=</span> <span class="b">get_mm_hiwater_rss</span><span class="f">(</span><span class="b">mm</span><span class="f">)</span><span class="f">;</span>
<a name="1252" /><span class="Maybe">    1252:</span> 
<a name="1253" /><span class="Maybe">    1253:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">*</span><span class="b">maxrss</span> <span class="f">&lt;</span> <span class="b">hiwater_rss</span><span class="f">)</span>
<a name="1254" /><span class="Maybe">    1254:</span>         <span class="f">*</span><span class="b">maxrss</span> <span class="f">=</span> <span class="b">hiwater_rss</span><span class="f">;</span>
<a name="1255" /><span class="Maybe">    1255:</span> <span class="f">}</span>
<a name="1256" /><span class="Maybe">    1256:</span> 
<a name="1257" /><span class="Maybe">    1257:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_U1BMSVRfUlNTX0NPVU5USU5HXzA_"><span class="b">SPLIT_RSS_COUNTING</span></a><span class="f">)</span>
<a name="1258" /><span class="Maybe">    1258:</span> <span class="m">void</span> <span class="b">sync_mm_rss</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span><span class="f">;</span>
<a name="1259" /><span class="False">    1259:</span> <span class="f">#</span><span class="n">else</span>
<a name="1260" /><span class="False">    1260:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">sync_mm_rss</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span>
<a name="1261" /><span class="False">    1261:</span> <span class="f">{</span>
<a name="1262" /><span class="False">    1262:</span> <span class="f">}</span>
<a name="1263" /><span class="Maybe">    1263:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1264" /><span class="Maybe">    1264:</span> 
<a name="1265" /><span class="Maybe">    1265:</span> <span class="m">int</span> <span class="b">vma_wants_writenotify</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">)</span><span class="f">;</span>
<a name="1266" /><span class="Maybe">    1266:</span> 
<a name="1267" /><span class="Maybe">    1267:</span> <span class="m">extern</span> <span class="b">pte_t</span> <span class="f">*</span><span class="b">__get_locked_pte</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1268" /><span class="Maybe">    1268:</span>                    <span class="b">spinlock_t</span> <span class="f">*</span><span class="f">*</span><span class="b">ptl</span><span class="f">)</span><span class="f">;</span>
<a name="1269" /><span class="Maybe">    1269:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">pte_t</span> <span class="f">*</span><span class="b">get_locked_pte</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1270" /><span class="Maybe">    1270:</span>                     <span class="b">spinlock_t</span> <span class="f">*</span><span class="f">*</span><span class="b">ptl</span><span class="f">)</span>
<a name="1271" /><span class="Maybe">    1271:</span> <span class="f">{</span>
<a name="1272" /><span class="Maybe">    1272:</span>     <span class="b">pte_t</span> <span class="f">*</span><span class="b">ptep</span><span class="f">;</span>
<a name="1273" /><span class="Maybe">    1273:</span>     <a href="cpu.c_macros_ref.html#_X19jb25kX2xvY2tfMA__"><span class="b">__cond_lock</span></a><span class="f">(</span><span class="f">*</span><span class="b">ptl</span><span class="f">,</span> <span class="b">ptep</span> <span class="f">=</span> <span class="b">__get_locked_pte</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">addr</span><span class="f">,</span> <span class="b">ptl</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="1274" /><span class="Maybe">    1274:</span>     <span class="m">return</span> <span class="b">ptep</span><span class="f">;</span>
<a name="1275" /><span class="Maybe">    1275:</span> <span class="f">}</span>
<a name="1276" /><span class="Maybe">    1276:</span> 
<a name="1277" /><span class="False">    1277:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__PAGETABLE_PUD_FOLDED</span>
<a name="1278" /><span class="False">    1278:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">__pud_alloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pgd_t</span> <span class="f">*</span><span class="b">pgd</span><span class="f">,</span>
<a name="1279" /><span class="False">    1279:</span>                         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span>
<a name="1280" /><span class="False">    1280:</span> <span class="f">{</span>
<a name="1281" /><span class="False">    1281:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="1282" /><span class="False">    1282:</span> <span class="f">}</span>
<a name="1283" /><span class="Maybe">    1283:</span> <span class="f">#</span><span class="n">else</span>
<a name="1284" /><span class="Maybe">    1284:</span> <span class="m">int</span> <span class="b">__pud_alloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pgd_t</span> <span class="f">*</span><span class="b">pgd</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>
<a name="1285" /><span class="Maybe">    1285:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1286" /><span class="Maybe">    1286:</span> 
<a name="1287" /><span class="False">    1287:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__PAGETABLE_PMD_FOLDED</span>
<a name="1288" /><span class="False">    1288:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">__pmd_alloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pud_t</span> <span class="f">*</span><span class="b">pud</span><span class="f">,</span>
<a name="1289" /><span class="False">    1289:</span>                         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span>
<a name="1290" /><span class="False">    1290:</span> <span class="f">{</span>
<a name="1291" /><span class="False">    1291:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="1292" /><span class="False">    1292:</span> <span class="f">}</span>
<a name="1293" /><span class="Maybe">    1293:</span> <span class="f">#</span><span class="n">else</span>
<a name="1294" /><span class="Maybe">    1294:</span> <span class="m">int</span> <span class="b">__pmd_alloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pud_t</span> <span class="f">*</span><span class="b">pud</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>
<a name="1295" /><span class="Maybe">    1295:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1296" /><span class="Maybe">    1296:</span> 
<a name="1297" /><span class="Maybe">    1297:</span> <span class="m">int</span> <span class="b">__pte_alloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1298" /><span class="Maybe">    1298:</span>         <span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>
<a name="1299" /><span class="Maybe">    1299:</span> <span class="m">int</span> <span class="b">__pte_alloc_kernel</span><span class="f">(</span><span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>
<a name="1300" /><span class="Maybe">    1300:</span> 
<a name="1301" /><span class="Maybe">    1301:</span> <span class="k">/*</span>
<a name="1302" /><span class="Maybe">    1302:</span> <span class="k"> * The following ifdef needed to get the 4level-fixup.h header to work.</span>
<a name="1303" /><span class="Maybe">    1303:</span> <span class="k"> * Remove it when 4level-fixup.h has been removed.</span>
<a name="1304" /><span class="Maybe">    1304:</span> <span class="k"> */</span>
<a name="1305" /><span class="Maybe">    1305:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">__ARCH_HAS_4LEVEL_HACK</span><span class="f">)</span>
<a name="1306" /><span class="Maybe">    1306:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">pud_t</span> <span class="f">*</span><span class="b">pud_alloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pgd_t</span> <span class="f">*</span><span class="b">pgd</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span>
<a name="1307" /><span class="Maybe">    1307:</span> <span class="f">{</span>
<a name="1308" /><span class="Maybe">    1308:</span>     <span class="m">return</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">pgd_none</span><span class="f">(</span><span class="f">*</span><span class="b">pgd</span><span class="f">)</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="b">__pud_alloc</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">pgd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">)</span><span class="f">?</span>
<a name="1309" /><span class="Maybe">    1309:</span>         <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">:</span> <span class="b">pud_offset</span><span class="f">(</span><span class="b">pgd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>
<a name="1310" /><span class="Maybe">    1310:</span> <span class="f">}</span>
<a name="1311" /><span class="Maybe">    1311:</span> 
<a name="1312" /><span class="Maybe">    1312:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd_alloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pud_t</span> <span class="f">*</span><span class="b">pud</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span>
<a name="1313" /><span class="Maybe">    1313:</span> <span class="f">{</span>
<a name="1314" /><span class="Maybe">    1314:</span>     <span class="m">return</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">pud_none</span><span class="f">(</span><span class="f">*</span><span class="b">pud</span><span class="f">)</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="b">__pmd_alloc</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">pud</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">)</span><span class="f">?</span>
<a name="1315" /><span class="Maybe">    1315:</span>         <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">:</span> <span class="b">pmd_offset</span><span class="f">(</span><span class="b">pud</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>
<a name="1316" /><span class="Maybe">    1316:</span> <span class="f">}</span>
<a name="1317" /><span class="Maybe">    1317:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_MMU &amp;&amp; !__ARCH_HAS_4LEVEL_HACK */</span>
<a name="1318" /><span class="Maybe">    1318:</span> 
<a name="1319" /><span class="Maybe">    1319:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_VVNFX1NQTElUX1BURV9QVExPQ0tTXzA_"><span class="b">USE_SPLIT_PTE_PTLOCKS</span></a>
<a name="1320" /><span class="False">    1320:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_QUxMT0NfU1BMSVRfUFRMT0NLU18w"><span class="b">ALLOC_SPLIT_PTLOCKS</span></a>
<a name="1321" /><span class="False">    1321:</span> <span class="m">extern</span> <span class="m">bool</span> <span class="b">ptlock_alloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1322" /><span class="False">    1322:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">ptlock_free</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1323" /><span class="False">    1323:</span> 
<a name="1324" /><span class="False">    1324:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">spinlock_t</span> <span class="f">*</span><span class="b">ptlock_ptr</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1325" /><span class="False">    1325:</span> <span class="f">{</span>
<a name="1326" /><span class="False">    1326:</span>     <span class="m">return</span> <span class="b">page</span><span class="f">-&gt;</span><span class="b">ptl</span><span class="f">;</span>
<a name="1327" /><span class="False">    1327:</span> <span class="f">}</span>
<a name="1328" /><span class="Maybe">    1328:</span> <span class="f">#</span><span class="n">else</span> <span class="k">/* ALLOC_SPLIT_PTLOCKS */</span>
<a name="1329" /><span class="Maybe">    1329:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">ptlock_alloc</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1330" /><span class="Maybe">    1330:</span> <span class="f">{</span>
<a name="1331" /><span class="Maybe">    1331:</span>     <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="1332" /><span class="Maybe">    1332:</span> <span class="f">}</span>
<a name="1333" /><span class="Maybe">    1333:</span> 
<a name="1334" /><span class="Maybe">    1334:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">ptlock_free</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1335" /><span class="Maybe">    1335:</span> <span class="f">{</span>
<a name="1336" /><span class="Maybe">    1336:</span> <span class="f">}</span>
<a name="1337" /><span class="Maybe">    1337:</span> 
<a name="1338" /><span class="Maybe">    1338:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">spinlock_t</span> <span class="f">*</span><span class="b">ptlock_ptr</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1339" /><span class="Maybe">    1339:</span> <span class="f">{</span>
<a name="1340" /><span class="Maybe">    1340:</span>     <span class="m">return</span> <span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">ptl</span><span class="f">;</span>
<a name="1341" /><span class="Maybe">    1341:</span> <span class="f">}</span>
<a name="1342" /><span class="Maybe">    1342:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* ALLOC_SPLIT_PTLOCKS */</span>
<a name="1343" /><span class="Maybe">    1343:</span> 
<a name="1344" /><span class="Maybe">    1344:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">spinlock_t</span> <span class="f">*</span><span class="b">pte_lockptr</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd</span><span class="f">)</span>
<a name="1345" /><span class="Maybe">    1345:</span> <span class="f">{</span>
<a name="1346" /><span class="Maybe">    1346:</span>     <span class="m">return</span> <span class="b">ptlock_ptr</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_cG1kX3BhZ2VfMA__"><span class="b">pmd_page</span></a><span class="f">(</span><span class="f">*</span><span class="b">pmd</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="1347" /><span class="Maybe">    1347:</span> <span class="f">}</span>
<a name="1348" /><span class="Maybe">    1348:</span> 
<a name="1349" /><span class="Maybe">    1349:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">ptlock_init</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1350" /><span class="Maybe">    1350:</span> <span class="f">{</span>
<a name="1351" /><span class="Maybe">    1351:</span>     <span class="k">/*</span>
<a name="1352" /><span class="Maybe">    1352:</span> <span class="k">     * prep_new_page() initialize page-&gt;private (and therefore page-&gt;ptl)</span>
<a name="1353" /><span class="Maybe">    1353:</span> <span class="k">     * with 0. Make sure nobody took it in use in between.</span>
<a name="1354" /><span class="Maybe">    1354:</span> <span class="k">     *</span>
<a name="1355" /><span class="Maybe">    1355:</span> <span class="k">     * It can happen if arch try to use slab for page table allocation:</span>
<a name="1356" /><span class="Maybe">    1356:</span> <span class="k">     * slab code uses page-&gt;slab_cache and page-&gt;first_page (for tail</span>
<a name="1357" /><span class="Maybe">    1357:</span> <span class="k">     * pages), which share storage with page-&gt;ptl.</span>
<a name="1358" /><span class="Maybe">    1358:</span> <span class="k">     */</span>
<a name="1359" /><span class="Maybe">    1359:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="f">*</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="f">)</span><span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">ptl</span><span class="f">)</span><span class="f">;</span>
<a name="1360" /><span class="Maybe">    1360:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">!</span><span class="b">ptlock_alloc</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span>
<a name="1361" /><span class="Maybe">    1361:</span>         <span class="m">return</span> <span class="m">false</span><span class="f">;</span>
<a name="1362" /><span class="Maybe">    1362:</span>     <a href="cpu.c_macros_ref.html#_c3Bpbl9sb2NrX2luaXRfMA__"><span class="b">spin_lock_init</span></a><span class="f">(</span><span class="b">ptlock_ptr</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="1363" /><span class="Maybe">    1363:</span>     <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="1364" /><span class="Maybe">    1364:</span> <span class="f">}</span>
<a name="1365" /><span class="Maybe">    1365:</span> 
<a name="1366" /><span class="Maybe">    1366:</span> <span class="k">/* Reset page-&gt;mapping so free_pages_check won&apos;t complain. */</span>
<a name="1367" /><span class="Maybe">    1367:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">pte_lock_deinit</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1368" /><span class="Maybe">    1368:</span> <span class="f">{</span>
<a name="1369" /><span class="Maybe">    1369:</span>     <span class="b">page</span><span class="f">-&gt;</span><span class="b">mapping</span> <span class="f">=</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="1370" /><span class="Maybe">    1370:</span>     <span class="b">ptlock_free</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1371" /><span class="Maybe">    1371:</span> <span class="f">}</span>
<a name="1372" /><span class="Maybe">    1372:</span> 
<a name="1373" /><span class="False">    1373:</span> <span class="f">#</span><span class="n">else</span>    <span class="k">/* !USE_SPLIT_PTE_PTLOCKS */</span>
<a name="1374" /><span class="False">    1374:</span> <span class="k">/*</span>
<a name="1375" /><span class="False">    1375:</span> <span class="k"> * We use mm-&gt;page_table_lock to guard all pagetable pages of the mm.</span>
<a name="1376" /><span class="False">    1376:</span> <span class="k"> */</span>
<a name="1377" /><span class="False">    1377:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">spinlock_t</span> <span class="f">*</span><span class="b">pte_lockptr</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd</span><span class="f">)</span>
<a name="1378" /><span class="False">    1378:</span> <span class="f">{</span>
<a name="1379" /><span class="False">    1379:</span>     <span class="m">return</span> <span class="f">&amp;</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">page_table_lock</span><span class="f">;</span>
<a name="1380" /><span class="False">    1380:</span> <span class="f">}</span>
<a name="1381" /><span class="False">    1381:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">ptlock_init</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span> <span class="f">{</span> <span class="m">return</span> <span class="m">true</span><span class="f">;</span> <span class="f">}</span>
<a name="1382" /><span class="False">    1382:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">pte_lock_deinit</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span> <span class="f">{</span><span class="f">}</span>
<a name="1383" /><span class="Maybe">    1383:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* USE_SPLIT_PTE_PTLOCKS */</span>
<a name="1384" /><span class="Maybe">    1384:</span> 
<a name="1385" /><span class="Maybe">    1385:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">pgtable_page_ctor</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1386" /><span class="Maybe">    1386:</span> <span class="f">{</span>
<a name="1387" /><span class="Maybe">    1387:</span>     <span class="b">inc_zone_page_state</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">NR_PAGETABLE</span><span class="f">)</span><span class="f">;</span>
<a name="1388" /><span class="Maybe">    1388:</span>     <span class="m">return</span> <span class="b">ptlock_init</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1389" /><span class="Maybe">    1389:</span> <span class="f">}</span>
<a name="1390" /><span class="Maybe">    1390:</span> 
<a name="1391" /><span class="Maybe">    1391:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">pgtable_page_dtor</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1392" /><span class="Maybe">    1392:</span> <span class="f">{</span>
<a name="1393" /><span class="Maybe">    1393:</span>     <span class="b">pte_lock_deinit</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1394" /><span class="Maybe">    1394:</span>     <span class="b">dec_zone_page_state</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">NR_PAGETABLE</span><span class="f">)</span><span class="f">;</span>
<a name="1395" /><span class="Maybe">    1395:</span> <span class="f">}</span>
<a name="1396" /><span class="Maybe">    1396:</span> 
<a name="1397" /><span class="Maybe">    1397:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cHRlX29mZnNldF9tYXBfbG9ja18w"><span class="b">pte_offset_map_lock</span></a><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">,</span> <span class="b">ptlp</span><span class="f">)</span>    \
<a name="1398" /><span class="Maybe">    1398:</span> <span class="f">(</span><span class="f">{</span>                            \
<a name="1399" /><span class="Maybe">    1399:</span>     <span class="b">spinlock_t</span> <span class="f">*</span><span class="b">__ptl</span> <span class="f">=</span> <span class="b">pte_lockptr</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd</span><span class="f">)</span><span class="f">;</span>    \
<a name="1400" /><span class="Maybe">    1400:</span>     <span class="b">pte_t</span> <span class="f">*</span><a href="cpu.c_macros_ref.html#_X19wdGVfMA__"><span class="b">__pte</span></a> <span class="f">=</span> <a href="cpu.c_macros_noref.html#_cHRlX29mZnNldF9tYXBfMA__"><span class="b">pte_offset_map</span></a><span class="f">(</span><span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>    \
<a name="1401" /><span class="Maybe">    1401:</span>     <span class="f">*</span><span class="f">(</span><span class="b">ptlp</span><span class="f">)</span> <span class="f">=</span> <span class="b">__ptl</span><span class="f">;</span>                \
<a name="1402" /><span class="Maybe">    1402:</span>     <span class="b">spin_lock</span><span class="f">(</span><span class="b">__ptl</span><span class="f">)</span><span class="f">;</span>                \
<a name="1403" /><span class="Maybe">    1403:</span>     <a href="cpu.c_macros_ref.html#_X19wdGVfMA__"><span class="b">__pte</span></a><span class="f">;</span>                        \
<a name="1404" /><span class="Maybe">    1404:</span> <span class="f">}</span><span class="f">)</span>
<a name="1405" /><span class="Maybe">    1405:</span> 
<a name="1406" /><span class="Maybe">    1406:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cHRlX3VubWFwX3VubG9ja18w"><span class="b">pte_unmap_unlock</span></a><span class="f">(</span><span class="b">pte</span><span class="f">,</span> <span class="b">ptl</span><span class="f">)</span>    <span class="m">do</span> <span class="f">{</span>        \
<a name="1407" /><span class="Maybe">    1407:</span>     <span class="b">spin_unlock</span><span class="f">(</span><span class="b">ptl</span><span class="f">)</span><span class="f">;</span>                \
<a name="1408" /><span class="Maybe">    1408:</span>     <a href="cpu.c_macros_noref.html#_cHRlX3VubWFwXzA_"><span class="b">pte_unmap</span></a><span class="f">(</span><span class="b">pte</span><span class="f">)</span><span class="f">;</span>                    \
<a name="1409" /><span class="Maybe">    1409:</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="1410" /><span class="Maybe">    1410:</span> 
<a name="1411" /><span class="Maybe">    1411:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cHRlX2FsbG9jX21hcF8w"><span class="b">pte_alloc_map</span></a><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">vma</span><span class="f">,</span> <span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span>                \
<a name="1412" /><span class="Maybe">    1412:</span>     <span class="f">(</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">pmd_none</span><span class="f">(</span><span class="f">*</span><span class="f">(</span><span class="b">pmd</span><span class="f">)</span><span class="f">)</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="b">__pte_alloc</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">vma</span><span class="f">,</span>    \
<a name="1413" /><span class="Maybe">    1413:</span>                             <span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">)</span><span class="f">?</span>    \
<a name="1414" /><span class="Maybe">    1414:</span>      <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">:</span> <a href="cpu.c_macros_noref.html#_cHRlX29mZnNldF9tYXBfMA__"><span class="b">pte_offset_map</span></a><span class="f">(</span><span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">)</span>
<a name="1415" /><span class="Maybe">    1415:</span> 
<a name="1416" /><span class="Maybe">    1416:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cHRlX2FsbG9jX21hcF9sb2NrXzA_"><span class="b">pte_alloc_map_lock</span></a><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">,</span> <span class="b">ptlp</span><span class="f">)</span>    \
<a name="1417" /><span class="Maybe">    1417:</span>     <span class="f">(</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">pmd_none</span><span class="f">(</span><span class="f">*</span><span class="f">(</span><span class="b">pmd</span><span class="f">)</span><span class="f">)</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="b">__pte_alloc</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">,</span>    \
<a name="1418" /><span class="Maybe">    1418:</span>                             <span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">)</span><span class="f">?</span>    \
<a name="1419" /><span class="Maybe">    1419:</span>         <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">:</span> <a href="cpu.c_macros_noref.html#_cHRlX29mZnNldF9tYXBfbG9ja18w"><span class="b">pte_offset_map_lock</span></a><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">,</span> <span class="b">ptlp</span><span class="f">)</span><span class="f">)</span>
<a name="1420" /><span class="Maybe">    1420:</span> 
<a name="1421" /><span class="Maybe">    1421:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cHRlX2FsbG9jX2tlcm5lbF8w"><span class="b">pte_alloc_kernel</span></a><span class="f">(</span><span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span>            \
<a name="1422" /><span class="Maybe">    1422:</span>     <span class="f">(</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">pmd_none</span><span class="f">(</span><span class="f">*</span><span class="f">(</span><span class="b">pmd</span><span class="f">)</span><span class="f">)</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="b">__pte_alloc_kernel</span><span class="f">(</span><span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">)</span><span class="f">?</span> \
<a name="1423" /><span class="Maybe">    1423:</span>         <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">:</span> <span class="b">pte_offset_kernel</span><span class="f">(</span><span class="b">pmd</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span><span class="f">)</span>
<a name="1424" /><span class="Maybe">    1424:</span> 
<a name="1425" /><span class="Maybe">    1425:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_VVNFX1NQTElUX1BNRF9QVExPQ0tTXzA_"><span class="b">USE_SPLIT_PMD_PTLOCKS</span></a>
<a name="1426" /><span class="Maybe">    1426:</span> 
<a name="1427" /><span class="Maybe">    1427:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">spinlock_t</span> <span class="f">*</span><span class="b">pmd_lockptr</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd</span><span class="f">)</span>
<a name="1428" /><span class="Maybe">    1428:</span> <span class="f">{</span>
<a name="1429" /><span class="Maybe">    1429:</span>     <span class="m">return</span> <span class="b">ptlock_ptr</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_dmlydF90b19wYWdlXzA_"><span class="b">virt_to_page</span></a><span class="f">(</span><span class="b">pmd</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="1430" /><span class="Maybe">    1430:</span> <span class="f">}</span>
<a name="1431" /><span class="Maybe">    1431:</span> 
<a name="1432" /><span class="Maybe">    1432:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">pgtable_pmd_page_ctor</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1433" /><span class="Maybe">    1433:</span> <span class="f">{</span>
<a name="1434" /><span class="False">    1434:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_TRANSPARENT_HUGEPAGE</span>
<a name="1435" /><span class="False">    1435:</span>     <span class="b">page</span><span class="f">-&gt;</span><a href="cpu.c_macros_noref.html#_cG1kX2h1Z2VfcHRlXzA_"><span class="b">pmd_huge_pte</span></a> <span class="f">=</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="1436" /><span class="Maybe">    1436:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1437" /><span class="Maybe">    1437:</span>     <span class="m">return</span> <span class="b">ptlock_init</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1438" /><span class="Maybe">    1438:</span> <span class="f">}</span>
<a name="1439" /><span class="Maybe">    1439:</span> 
<a name="1440" /><span class="Maybe">    1440:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">pgtable_pmd_page_dtor</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1441" /><span class="Maybe">    1441:</span> <span class="f">{</span>
<a name="1442" /><span class="False">    1442:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_TRANSPARENT_HUGEPAGE</span>
<a name="1443" /><span class="False">    1443:</span>     <a href="cpu.c_macros_ref.html#_Vk1fQlVHX09OXzA_"><span class="b">VM_BUG_ON</span></a><span class="f">(</span><span class="b">page</span><span class="f">-&gt;</span><a href="cpu.c_macros_noref.html#_cG1kX2h1Z2VfcHRlXzA_"><span class="b">pmd_huge_pte</span></a><span class="f">)</span><span class="f">;</span>
<a name="1444" /><span class="Maybe">    1444:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1445" /><span class="Maybe">    1445:</span>     <span class="b">ptlock_free</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1446" /><span class="Maybe">    1446:</span> <span class="f">}</span>
<a name="1447" /><span class="Maybe">    1447:</span> 
<a name="1448" /><span class="Maybe">    1448:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cG1kX2h1Z2VfcHRlXzA_"><span class="b">pmd_huge_pte</span></a><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd</span><span class="f">)</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dmlydF90b19wYWdlXzA_"><span class="b">virt_to_page</span></a><span class="f">(</span><span class="b">pmd</span><span class="f">)</span><span class="f">-&gt;</span><a href="cpu.c_macros_noref.html#_cG1kX2h1Z2VfcHRlXzA_"><span class="b">pmd_huge_pte</span></a><span class="f">)</span>
<a name="1449" /><span class="Maybe">    1449:</span> 
<a name="1450" /><span class="False">    1450:</span> <span class="f">#</span><span class="n">else</span>
<a name="1451" /><span class="False">    1451:</span> 
<a name="1452" /><span class="False">    1452:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">spinlock_t</span> <span class="f">*</span><span class="b">pmd_lockptr</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd</span><span class="f">)</span>
<a name="1453" /><span class="False">    1453:</span> <span class="f">{</span>
<a name="1454" /><span class="False">    1454:</span>     <span class="m">return</span> <span class="f">&amp;</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">page_table_lock</span><span class="f">;</span>
<a name="1455" /><span class="False">    1455:</span> <span class="f">}</span>
<a name="1456" /><span class="False">    1456:</span> 
<a name="1457" /><span class="False">    1457:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">pgtable_pmd_page_ctor</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span> <span class="f">{</span> <span class="m">return</span> <span class="m">true</span><span class="f">;</span> <span class="f">}</span>
<a name="1458" /><span class="False">    1458:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">pgtable_pmd_page_dtor</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span> <span class="f">{</span><span class="f">}</span>
<a name="1459" /><span class="False">    1459:</span> 
<a name="1460" /><span class="False">    1460:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cG1kX2h1Z2VfcHRlXzA_"><span class="b">pmd_huge_pte</span></a><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="b">mm</span><span class="f">)</span><span class="f">-&gt;</span><a href="cpu.c_macros_noref.html#_cG1kX2h1Z2VfcHRlXzA_"><span class="b">pmd_huge_pte</span></a><span class="f">)</span>
<a name="1461" /><span class="False">    1461:</span> 
<a name="1462" /><span class="Maybe">    1462:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1463" /><span class="Maybe">    1463:</span> 
<a name="1464" /><span class="Maybe">    1464:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">spinlock_t</span> <span class="f">*</span><span class="b">pmd_lock</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd</span><span class="f">)</span>
<a name="1465" /><span class="Maybe">    1465:</span> <span class="f">{</span>
<a name="1466" /><span class="Maybe">    1466:</span>     <span class="b">spinlock_t</span> <span class="f">*</span><span class="b">ptl</span> <span class="f">=</span> <span class="b">pmd_lockptr</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">pmd</span><span class="f">)</span><span class="f">;</span>
<a name="1467" /><span class="Maybe">    1467:</span>     <span class="b">spin_lock</span><span class="f">(</span><span class="b">ptl</span><span class="f">)</span><span class="f">;</span>
<a name="1468" /><span class="Maybe">    1468:</span>     <span class="m">return</span> <span class="b">ptl</span><span class="f">;</span>
<a name="1469" /><span class="Maybe">    1469:</span> <span class="f">}</span>
<a name="1470" /><span class="Maybe">    1470:</span> 
<a name="1471" /><span class="Maybe">    1471:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">free_area_init</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span> <span class="b">zones_size</span><span class="f">)</span><span class="f">;</span>
<a name="1472" /><span class="Maybe">    1472:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">free_area_init_node</span><span class="f">(</span><span class="m">int</span> <span class="b">nid</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span> <span class="b">zones_size</span><span class="f">,</span>
<a name="1473" /><span class="Maybe">    1473:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">zone_start_pfn</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">zholes_size</span><span class="f">)</span><span class="f">;</span>
<a name="1474" /><span class="Maybe">    1474:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">free_initmem</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1475" /><span class="Maybe">    1475:</span> 
<a name="1476" /><span class="Maybe">    1476:</span> <span class="k">/*</span>
<a name="1477" /><span class="Maybe">    1477:</span> <span class="k"> * Free reserved pages within range [PAGE_ALIGN(start), end &amp; PAGE_MASK)</span>
<a name="1478" /><span class="Maybe">    1478:</span> <span class="k"> * into the buddy system. The freed pages will be poisoned with pattern</span>
<a name="1479" /><span class="Maybe">    1479:</span> <span class="k"> * &quot;poison&quot; if it&apos;s within range [0, UCHAR_MAX].</span>
<a name="1480" /><span class="Maybe">    1480:</span> <span class="k"> * Return pages freed into the buddy system.</span>
<a name="1481" /><span class="Maybe">    1481:</span> <span class="k"> */</span>
<a name="1482" /><span class="Maybe">    1482:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">free_reserved_area</span><span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="b">start</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">end</span><span class="f">,</span>
<a name="1483" /><span class="Maybe">    1483:</span>                     <span class="m">int</span> <span class="b">poison</span><span class="f">,</span> <span class="m">char</span> <span class="f">*</span><span class="b">s</span><span class="f">)</span><span class="f">;</span>
<a name="1484" /><span class="Maybe">    1484:</span> 
<a name="1485" /><span class="False">    1485:</span> <span class="f">#</span><span class="n">ifdef</span>    <span class="b">CONFIG_HIGHMEM</span>
<a name="1486" /><span class="False">    1486:</span> <span class="k">/*</span>
<a name="1487" /><span class="False">    1487:</span> <span class="k"> * Free a highmem page into the buddy system, adjusting totalhigh_pages</span>
<a name="1488" /><span class="False">    1488:</span> <span class="k"> * and totalram_pages.</span>
<a name="1489" /><span class="False">    1489:</span> <span class="k"> */</span>
<a name="1490" /><span class="False">    1490:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">free_highmem_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1491" /><span class="Maybe">    1491:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1492" /><span class="Maybe">    1492:</span> 
<a name="1493" /><span class="Maybe">    1493:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">adjust_managed_page_count</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">long</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="1494" /><span class="Maybe">    1494:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_init_print_info</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">str</span><span class="f">)</span><span class="f">;</span>
<a name="1495" /><span class="Maybe">    1495:</span> 
<a name="1496" /><span class="Maybe">    1496:</span> <span class="k">/* Free the reserved page into the buddy system, so it gets managed. */</span>
<a name="1497" /><span class="Maybe">    1497:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">__free_reserved_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1498" /><span class="Maybe">    1498:</span> <span class="f">{</span>
<a name="1499" /><span class="Maybe">    1499:</span>     <span class="b">ClearPageReserved</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1500" /><span class="Maybe">    1500:</span>     <span class="b">init_page_count</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1501" /><span class="Maybe">    1501:</span>     <a href="cpu.c_macros_ref.html#_X19mcmVlX3BhZ2VfMA__"><span class="b">__free_page</span></a><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1502" /><span class="Maybe">    1502:</span> <span class="f">}</span>
<a name="1503" /><span class="Maybe">    1503:</span> 
<a name="1504" /><span class="Maybe">    1504:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">free_reserved_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1505" /><span class="Maybe">    1505:</span> <span class="f">{</span>
<a name="1506" /><span class="Maybe">    1506:</span>     <span class="b">__free_reserved_page</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1507" /><span class="Maybe">    1507:</span>     <span class="b">adjust_managed_page_count</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="1508" /><span class="Maybe">    1508:</span> <span class="f">}</span>
<a name="1509" /><span class="Maybe">    1509:</span> 
<a name="1510" /><span class="Maybe">    1510:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mark_page_reserved</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="1511" /><span class="Maybe">    1511:</span> <span class="f">{</span>
<a name="1512" /><span class="Maybe">    1512:</span>     <span class="b">SetPageReserved</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1513" /><span class="Maybe">    1513:</span>     <span class="b">adjust_managed_page_count</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="f">-</span><span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="1514" /><span class="Maybe">    1514:</span> <span class="f">}</span>
<a name="1515" /><span class="Maybe">    1515:</span> 
<a name="1516" /><span class="Maybe">    1516:</span> <span class="k">/*</span>
<a name="1517" /><span class="Maybe">    1517:</span> <span class="k"> * Default method to free all the __init memory into the buddy system.</span>
<a name="1518" /><span class="Maybe">    1518:</span> <span class="k"> * The freed pages will be poisoned with pattern &quot;poison&quot; if it&apos;s within</span>
<a name="1519" /><span class="Maybe">    1519:</span> <span class="k"> * range [0, UCHAR_MAX].</span>
<a name="1520" /><span class="Maybe">    1520:</span> <span class="k"> * Return pages freed into the buddy system.</span>
<a name="1521" /><span class="Maybe">    1521:</span> <span class="k"> */</span>
<a name="1522" /><span class="Maybe">    1522:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">free_initmem_default</span><span class="f">(</span><span class="m">int</span> <span class="b">poison</span><span class="f">)</span>
<a name="1523" /><span class="Maybe">    1523:</span> <span class="f">{</span>
<a name="1524" /><span class="Maybe">    1524:</span>     <span class="m">extern</span> <span class="m">char</span> <span class="b">__init_begin</span><span class="f">[</span><span class="f">]</span><span class="f">,</span> <span class="b">__init_end</span><span class="f">[</span><span class="f">]</span><span class="f">;</span>
<a name="1525" /><span class="Maybe">    1525:</span> 
<a name="1526" /><span class="Maybe">    1526:</span>     <span class="m">return</span> <span class="b">free_reserved_area</span><span class="f">(</span><span class="f">&amp;</span><span class="b">__init_begin</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">__init_end</span><span class="f">,</span>
<a name="1527" /><span class="Maybe">    1527:</span>                   <span class="b">poison</span><span class="f">,</span> <span class="e">&quot;unused kernel&quot;</span><span class="f">)</span><span class="f">;</span>
<a name="1528" /><span class="Maybe">    1528:</span> <span class="f">}</span>
<a name="1529" /><span class="Maybe">    1529:</span> 
<a name="1530" /><span class="Maybe">    1530:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">get_num_physpages</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="1531" /><span class="Maybe">    1531:</span> <span class="f">{</span>
<a name="1532" /><span class="Maybe">    1532:</span>     <span class="m">int</span> <span class="b">nid</span><span class="f">;</span>
<a name="1533" /><span class="Maybe">    1533:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">phys_pages</span> <span class="f">=</span> <span class="c">0</span><span class="f">;</span>
<a name="1534" /><span class="Maybe">    1534:</span> 
<a name="1535" /><span class="Maybe">    1535:</span>     <a href="cpu.c_macros_ref.html#_Zm9yX2VhY2hfb25saW5lX25vZGVfMA__"><span class="b">for_each_online_node</span></a><span class="f">(</span><span class="b">nid</span><span class="f">)</span>
<a name="1536" /><span class="Maybe">    1536:</span>         <span class="b">phys_pages</span> <span class="f">+=</span> <a href="cpu.c_macros_ref.html#_bm9kZV9wcmVzZW50X3BhZ2VzXzA_"><span class="b">node_present_pages</span></a><span class="f">(</span><span class="b">nid</span><span class="f">)</span><span class="f">;</span>
<a name="1537" /><span class="Maybe">    1537:</span> 
<a name="1538" /><span class="Maybe">    1538:</span>     <span class="m">return</span> <span class="b">phys_pages</span><span class="f">;</span>
<a name="1539" /><span class="Maybe">    1539:</span> <span class="f">}</span>
<a name="1540" /><span class="Maybe">    1540:</span> 
<a name="1541" /><span class="Maybe">    1541:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX0hBVkVfTUVNQkxPQ0tfTk9ERV9NQVBfMA__"><span class="b">CONFIG_HAVE_MEMBLOCK_NODE_MAP</span></a>
<a name="1542" /><span class="Maybe">    1542:</span> <span class="k">/*</span>
<a name="1543" /><span class="Maybe">    1543:</span> <span class="k"> * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its</span>
<a name="1544" /><span class="Maybe">    1544:</span> <span class="k"> * zones, allocate the backing mem_map and account for memory holes in a more</span>
<a name="1545" /><span class="Maybe">    1545:</span> <span class="k"> * architecture independent manner. This is a substitute for creating the</span>
<a name="1546" /><span class="Maybe">    1546:</span> <span class="k"> * zone_sizes[] and zholes_size[] arrays and passing them to</span>
<a name="1547" /><span class="Maybe">    1547:</span> <span class="k"> * free_area_init_node()</span>
<a name="1548" /><span class="Maybe">    1548:</span> <span class="k"> *</span>
<a name="1549" /><span class="Maybe">    1549:</span> <span class="k"> * An architecture is expected to register range of page frames backed by</span>
<a name="1550" /><span class="Maybe">    1550:</span> <span class="k"> * physical memory with memblock_add[_node]() before calling</span>
<a name="1551" /><span class="Maybe">    1551:</span> <span class="k"> * free_area_init_nodes() passing in the PFN each zone ends at. At a basic</span>
<a name="1552" /><span class="Maybe">    1552:</span> <span class="k"> * usage, an architecture is expected to do something like</span>
<a name="1553" /><span class="Maybe">    1553:</span> <span class="k"> *</span>
<a name="1554" /><span class="Maybe">    1554:</span> <span class="k"> * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn,</span>
<a name="1555" /><span class="Maybe">    1555:</span> <span class="k"> *                              max_highmem_pfn};</span>
<a name="1556" /><span class="Maybe">    1556:</span> <span class="k"> * for_each_valid_physical_page_range()</span>
<a name="1557" /><span class="Maybe">    1557:</span> <span class="k"> *     memblock_add_node(base, size, nid)</span>
<a name="1558" /><span class="Maybe">    1558:</span> <span class="k"> * free_area_init_nodes(max_zone_pfns);</span>
<a name="1559" /><span class="Maybe">    1559:</span> <span class="k"> *</span>
<a name="1560" /><span class="Maybe">    1560:</span> <span class="k"> * free_bootmem_with_active_regions() calls free_bootmem_node() for each</span>
<a name="1561" /><span class="Maybe">    1561:</span> <span class="k"> * registered physical page range.  Similarly</span>
<a name="1562" /><span class="Maybe">    1562:</span> <span class="k"> * sparse_memory_present_with_active_regions() calls memory_present() for</span>
<a name="1563" /><span class="Maybe">    1563:</span> <span class="k"> * each range when SPARSEMEM is enabled.</span>
<a name="1564" /><span class="Maybe">    1564:</span> <span class="k"> *</span>
<a name="1565" /><span class="Maybe">    1565:</span> <span class="k"> * See mm/page_alloc.c for more information on each function exposed by</span>
<a name="1566" /><span class="Maybe">    1566:</span> <span class="k"> * CONFIG_HAVE_MEMBLOCK_NODE_MAP.</span>
<a name="1567" /><span class="Maybe">    1567:</span> <span class="k"> */</span>
<a name="1568" /><span class="Maybe">    1568:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">free_area_init_nodes</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">max_zone_pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1569" /><span class="Maybe">    1569:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">node_map_pfn_alignment</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1570" /><span class="Maybe">    1570:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">__absent_pages_in_range</span><span class="f">(</span><span class="m">int</span> <span class="b">nid</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start_pfn</span><span class="f">,</span>
<a name="1571" /><span class="Maybe">    1571:</span>                         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end_pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1572" /><span class="Maybe">    1572:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">absent_pages_in_range</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">start_pfn</span><span class="f">,</span>
<a name="1573" /><span class="Maybe">    1573:</span>                         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end_pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1574" /><span class="Maybe">    1574:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">get_pfn_range_for_nid</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">int</span> <span class="b">nid</span><span class="f">,</span>
<a name="1575" /><span class="Maybe">    1575:</span>             <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">start_pfn</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">end_pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1576" /><span class="Maybe">    1576:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">find_min_pfn_with_active_regions</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1577" /><span class="Maybe">    1577:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">free_bootmem_with_active_regions</span><span class="f">(</span><span class="m">int</span> <span class="b">nid</span><span class="f">,</span>
<a name="1578" /><span class="Maybe">    1578:</span>                         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">max_low_pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1579" /><span class="Maybe">    1579:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">sparse_memory_present_with_active_regions</span><span class="f">(</span><span class="m">int</span> <span class="b">nid</span><span class="f">)</span><span class="f">;</span>
<a name="1580" /><span class="Maybe">    1580:</span> 
<a name="1581" /><span class="Maybe">    1581:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_HAVE_MEMBLOCK_NODE_MAP */</span>
<a name="1582" /><span class="Maybe">    1582:</span> 
<a name="1583" /><span class="False">    1583:</span> <span class="f">#</span><span class="n">if</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX0hBVkVfTUVNQkxPQ0tfTk9ERV9NQVBfMA__"><span class="b">CONFIG_HAVE_MEMBLOCK_NODE_MAP</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span> \
<a name="1584" /><span class="False">    1584:</span>     <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID</span><span class="f">)</span>
<a name="1585" /><span class="False">    1585:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">__early_pfn_to_nid</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">)</span>
<a name="1586" /><span class="False">    1586:</span> <span class="f">{</span>
<a name="1587" /><span class="False">    1587:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="1588" /><span class="False">    1588:</span> <span class="f">}</span>
<a name="1589" /><span class="Maybe">    1589:</span> <span class="f">#</span><span class="n">else</span>
<a name="1590" /><span class="Maybe">    1590:</span> <span class="k">/* please see mm/page_alloc.c */</span>
<a name="1591" /><span class="Maybe">    1591:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tZW1pbml0XzA_"><span class="b">__meminit</span></a> <span class="b">early_pfn_to_nid</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1592" /><span class="False">    1592:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID</span>
<a name="1593" /><span class="False">    1593:</span> <span class="k">/* there is a per-arch backend function. */</span>
<a name="1594" /><span class="False">    1594:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tZW1pbml0XzA_"><span class="b">__meminit</span></a> <span class="b">__early_pfn_to_nid</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1595" /><span class="Maybe">    1595:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */</span>
<a name="1596" /><span class="Maybe">    1596:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1597" /><span class="Maybe">    1597:</span> 
<a name="1598" /><span class="Maybe">    1598:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">set_dma_reserve</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">new_dma_reserve</span><span class="f">)</span><span class="f">;</span>
<a name="1599" /><span class="Maybe">    1599:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">memmap_init_zone</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">int</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span>
<a name="1600" /><span class="Maybe">    1600:</span>                 <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">enum</span> <span class="b">memmap_context</span><span class="f">)</span><span class="f">;</span>
<a name="1601" /><span class="Maybe">    1601:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">setup_per_zone_wmarks</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1602" /><span class="Maybe">    1602:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19tZW1pbml0XzA_"><span class="b">__meminit</span></a> <span class="b">init_per_zone_wmark_min</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1603" /><span class="Maybe">    1603:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_init</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1604" /><span class="Maybe">    1604:</span> <span class="m">extern</span> <span class="m">void</span> <a href="cpu.c_macros_ref.html#_X19pbml0XzA_"><span class="b">__init</span></a> <span class="b">mmap_init</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1605" /><span class="Maybe">    1605:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">show_mem</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">int</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="1606" /><span class="Maybe">    1606:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">si_meminfo</span><span class="f">(</span><span class="m">struct</span> <span class="b">sysinfo</span> <span class="f">*</span> <span class="b">val</span><span class="f">)</span><span class="f">;</span>
<a name="1607" /><span class="Maybe">    1607:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">si_meminfo_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">sysinfo</span> <span class="f">*</span><span class="b">val</span><span class="f">,</span> <span class="m">int</span> <span class="b">nid</span><span class="f">)</span><span class="f">;</span>
<a name="1608" /><span class="Maybe">    1608:</span> 
<a name="1609" /><span class="Maybe">    1609:</span> <span class="m">extern</span> <a href="cpu.c_macros_ref.html#_X19wcmludGZfMA__"><span class="b">__printf</span></a><span class="f">(</span><span class="c">3</span><span class="f">,</span> <span class="c">4</span><span class="f">)</span>
<a name="1610" /><span class="Maybe">    1610:</span> <span class="m">void</span> <span class="b">warn_alloc_failed</span><span class="f">(</span><span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">fmt</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="1611" /><span class="Maybe">    1611:</span> 
<a name="1612" /><span class="Maybe">    1612:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">setup_per_cpu_pageset</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1613" /><span class="Maybe">    1613:</span> 
<a name="1614" /><span class="Maybe">    1614:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">zone_pcp_update</span><span class="f">(</span><span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">zone</span><span class="f">)</span><span class="f">;</span>
<a name="1615" /><span class="Maybe">    1615:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">zone_pcp_reset</span><span class="f">(</span><span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">zone</span><span class="f">)</span><span class="f">;</span>
<a name="1616" /><span class="Maybe">    1616:</span> 
<a name="1617" /><span class="Maybe">    1617:</span> <span class="k">/* page_alloc.c */</span>
<a name="1618" /><span class="Maybe">    1618:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">min_free_kbytes</span><span class="f">;</span>
<a name="1619" /><span class="Maybe">    1619:</span> 
<a name="1620" /><span class="Maybe">    1620:</span> <span class="k">/* nommu.c */</span>
<a name="1621" /><span class="Maybe">    1621:</span> <span class="m">extern</span> <span class="b">atomic_long_t</span> <span class="b">mmap_pages_allocated</span><span class="f">;</span>
<a name="1622" /><span class="Maybe">    1622:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">nommu_shrink_inode_mappings</span><span class="f">(</span><span class="m">struct</span> <span class="b">inode</span> <span class="f">*</span><span class="f">,</span> <span class="b">size_t</span><span class="f">,</span> <span class="b">size_t</span><span class="f">)</span><span class="f">;</span>
<a name="1623" /><span class="Maybe">    1623:</span> 
<a name="1624" /><span class="Maybe">    1624:</span> <span class="k">/* interval_tree.c */</span>
<a name="1625" /><span class="Maybe">    1625:</span> <span class="m">void</span> <span class="b">vma_interval_tree_insert</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">node</span><span class="f">,</span>
<a name="1626" /><span class="Maybe">    1626:</span>                   <span class="m">struct</span> <span class="b">rb_root</span> <span class="f">*</span><span class="b">root</span><span class="f">)</span><span class="f">;</span>
<a name="1627" /><span class="Maybe">    1627:</span> <span class="m">void</span> <span class="b">vma_interval_tree_insert_after</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">node</span><span class="f">,</span>
<a name="1628" /><span class="Maybe">    1628:</span>                     <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">prev</span><span class="f">,</span>
<a name="1629" /><span class="Maybe">    1629:</span>                     <span class="m">struct</span> <span class="b">rb_root</span> <span class="f">*</span><span class="b">root</span><span class="f">)</span><span class="f">;</span>
<a name="1630" /><span class="Maybe">    1630:</span> <span class="m">void</span> <span class="b">vma_interval_tree_remove</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">node</span><span class="f">,</span>
<a name="1631" /><span class="Maybe">    1631:</span>                   <span class="m">struct</span> <span class="b">rb_root</span> <span class="f">*</span><span class="b">root</span><span class="f">)</span><span class="f">;</span>
<a name="1632" /><span class="Maybe">    1632:</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma_interval_tree_iter_first</span><span class="f">(</span><span class="m">struct</span> <span class="b">rb_root</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span>
<a name="1633" /><span class="Maybe">    1633:</span>                 <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">last</span><span class="f">)</span><span class="f">;</span>
<a name="1634" /><span class="Maybe">    1634:</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma_interval_tree_iter_next</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">node</span><span class="f">,</span>
<a name="1635" /><span class="Maybe">    1635:</span>                 <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">last</span><span class="f">)</span><span class="f">;</span>
<a name="1636" /><span class="Maybe">    1636:</span> 
<a name="1637" /><span class="Maybe">    1637:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_dm1hX2ludGVydmFsX3RyZWVfZm9yZWFjaF8w"><span class="b">vma_interval_tree_foreach</span></a><span class="f">(</span><span class="b">vma</span><span class="f">,</span> <span class="b">root</span><span class="f">,</span> <span class="b">start</span><span class="f">,</span> <span class="b">last</span><span class="f">)</span>        \
<a name="1638" /><span class="Maybe">    1638:</span>     <span class="m">for</span> <span class="f">(</span><span class="b">vma</span> <span class="f">=</span> <span class="b">vma_interval_tree_iter_first</span><span class="f">(</span><span class="b">root</span><span class="f">,</span> <span class="b">start</span><span class="f">,</span> <span class="b">last</span><span class="f">)</span><span class="f">;</span>    \
<a name="1639" /><span class="Maybe">    1639:</span>          <span class="b">vma</span><span class="f">;</span> <span class="b">vma</span> <span class="f">=</span> <span class="b">vma_interval_tree_iter_next</span><span class="f">(</span><span class="b">vma</span><span class="f">,</span> <span class="b">start</span><span class="f">,</span> <span class="b">last</span><span class="f">)</span><span class="f">)</span>
<a name="1640" /><span class="Maybe">    1640:</span> 
<a name="1641" /><span class="Maybe">    1641:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">vma_nonlinear_insert</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1642" /><span class="Maybe">    1642:</span>                     <span class="m">struct</span> <span class="b">list_head</span> <span class="f">*</span><span class="b">list</span><span class="f">)</span>
<a name="1643" /><span class="Maybe">    1643:</span> <span class="f">{</span>
<a name="1644" /><span class="Maybe">    1644:</span>     <span class="b">list_add_tail</span><span class="f">(</span><span class="f">&amp;</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">shared</span><span class="f">.</span><span class="b">nonlinear</span><span class="f">,</span> <span class="b">list</span><span class="f">)</span><span class="f">;</span>
<a name="1645" /><span class="Maybe">    1645:</span> <span class="f">}</span>
<a name="1646" /><span class="Maybe">    1646:</span> 
<a name="1647" /><span class="Maybe">    1647:</span> <span class="m">void</span> <span class="b">anon_vma_interval_tree_insert</span><span class="f">(</span><span class="m">struct</span> <span class="b">anon_vma_chain</span> <span class="f">*</span><span class="b">node</span><span class="f">,</span>
<a name="1648" /><span class="Maybe">    1648:</span>                    <span class="m">struct</span> <span class="b">rb_root</span> <span class="f">*</span><span class="b">root</span><span class="f">)</span><span class="f">;</span>
<a name="1649" /><span class="Maybe">    1649:</span> <span class="m">void</span> <span class="b">anon_vma_interval_tree_remove</span><span class="f">(</span><span class="m">struct</span> <span class="b">anon_vma_chain</span> <span class="f">*</span><span class="b">node</span><span class="f">,</span>
<a name="1650" /><span class="Maybe">    1650:</span>                    <span class="m">struct</span> <span class="b">rb_root</span> <span class="f">*</span><span class="b">root</span><span class="f">)</span><span class="f">;</span>
<a name="1651" /><span class="Maybe">    1651:</span> <span class="m">struct</span> <span class="b">anon_vma_chain</span> <span class="f">*</span><span class="b">anon_vma_interval_tree_iter_first</span><span class="f">(</span>
<a name="1652" /><span class="Maybe">    1652:</span>     <span class="m">struct</span> <span class="b">rb_root</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">last</span><span class="f">)</span><span class="f">;</span>
<a name="1653" /><span class="Maybe">    1653:</span> <span class="m">struct</span> <span class="b">anon_vma_chain</span> <span class="f">*</span><span class="b">anon_vma_interval_tree_iter_next</span><span class="f">(</span>
<a name="1654" /><span class="Maybe">    1654:</span>     <span class="m">struct</span> <span class="b">anon_vma_chain</span> <span class="f">*</span><span class="b">node</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">last</span><span class="f">)</span><span class="f">;</span>
<a name="1655" /><span class="False">    1655:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_DEBUG_VM_RB</span>
<a name="1656" /><span class="False">    1656:</span> <span class="m">void</span> <span class="b">anon_vma_interval_tree_verify</span><span class="f">(</span><span class="m">struct</span> <span class="b">anon_vma_chain</span> <span class="f">*</span><span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="1657" /><span class="Maybe">    1657:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1658" /><span class="Maybe">    1658:</span> 
<a name="1659" /><span class="Maybe">    1659:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_YW5vbl92bWFfaW50ZXJ2YWxfdHJlZV9mb3JlYWNoXzA_"><span class="b">anon_vma_interval_tree_foreach</span></a><span class="f">(</span><span class="b">avc</span><span class="f">,</span> <span class="b">root</span><span class="f">,</span> <span class="b">start</span><span class="f">,</span> <span class="b">last</span><span class="f">)</span>         \
<a name="1660" /><span class="Maybe">    1660:</span>     <span class="m">for</span> <span class="f">(</span><span class="b">avc</span> <span class="f">=</span> <span class="b">anon_vma_interval_tree_iter_first</span><span class="f">(</span><span class="b">root</span><span class="f">,</span> <span class="b">start</span><span class="f">,</span> <span class="b">last</span><span class="f">)</span><span class="f">;</span> \
<a name="1661" /><span class="Maybe">    1661:</span>          <span class="b">avc</span><span class="f">;</span> <span class="b">avc</span> <span class="f">=</span> <span class="b">anon_vma_interval_tree_iter_next</span><span class="f">(</span><span class="b">avc</span><span class="f">,</span> <span class="b">start</span><span class="f">,</span> <span class="b">last</span><span class="f">)</span><span class="f">)</span>
<a name="1662" /><span class="Maybe">    1662:</span> 
<a name="1663" /><span class="Maybe">    1663:</span> <span class="k">/* mmap.c */</span>
<a name="1664" /><span class="Maybe">    1664:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">__vm_enough_memory</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">long</span> <span class="b">pages</span><span class="f">,</span> <span class="m">int</span> <span class="b">cap_sys_admin</span><span class="f">)</span><span class="f">;</span>
<a name="1665" /><span class="Maybe">    1665:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">vma_adjust</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span>
<a name="1666" /><span class="Maybe">    1666:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">pgoff</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">insert</span><span class="f">)</span><span class="f">;</span>
<a name="1667" /><span class="Maybe">    1667:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma_merge</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="f">,</span>
<a name="1668" /><span class="Maybe">    1668:</span>     <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">prev</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">,</span>
<a name="1669" /><span class="Maybe">    1669:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">vm_flags</span><span class="f">,</span> <span class="m">struct</span> <span class="b">anon_vma</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a><span class="f">,</span>
<a name="1670" /><span class="Maybe">    1670:</span>     <span class="m">struct</span> <span class="b">mempolicy</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1671" /><span class="Maybe">    1671:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">anon_vma</span> <span class="f">*</span><span class="b">find_mergeable_anon_vma</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1672" /><span class="Maybe">    1672:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">split_vma</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="f">,</span>
<a name="1673" /><span class="Maybe">    1673:</span>     <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">int</span> <span class="b">new_below</span><span class="f">)</span><span class="f">;</span>
<a name="1674" /><span class="Maybe">    1674:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">insert_vm_struct</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1675" /><span class="Maybe">    1675:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">__vma_link_rb</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">,</span>
<a name="1676" /><span class="Maybe">    1676:</span>     <span class="m">struct</span> <span class="b">rb_node</span> <span class="f">*</span><span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">rb_node</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1677" /><span class="Maybe">    1677:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">unlink_file_vma</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1678" /><span class="Maybe">    1678:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">copy_vma</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">*</span><span class="f">,</span>
<a name="1679" /><span class="Maybe">    1679:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">len</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">pgoff</span><span class="f">,</span>
<a name="1680" /><span class="Maybe">    1680:</span>     <span class="m">bool</span> <span class="f">*</span><span class="b">need_rmap_locks</span><span class="f">)</span><span class="f">;</span>
<a name="1681" /><span class="Maybe">    1681:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">exit_mmap</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1682" /><span class="Maybe">    1682:</span> 
<a name="1683" /><span class="Maybe">    1683:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">mm_take_all_locks</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span><span class="f">;</span>
<a name="1684" /><span class="Maybe">    1684:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mm_drop_all_locks</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span><span class="f">;</span>
<a name="1685" /><span class="Maybe">    1685:</span> 
<a name="1686" /><span class="Maybe">    1686:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">set_mm_exe_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">new_exe_file</span><span class="f">)</span><span class="f">;</span>
<a name="1687" /><span class="Maybe">    1687:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">get_mm_exe_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span><span class="f">;</span>
<a name="1688" /><span class="Maybe">    1688:</span> 
<a name="1689" /><span class="Maybe">    1689:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">may_expand_vm</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">npages</span><span class="f">)</span><span class="f">;</span>
<a name="1690" /><span class="Maybe">    1690:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">install_special_mapping</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="1691" /><span class="Maybe">    1691:</span>                    <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">len</span><span class="f">,</span>
<a name="1692" /><span class="Maybe">    1692:</span>                    <span class="m">unsigned</span> <span class="m">long</span> <span class="b">flags</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="b">pages</span><span class="f">)</span><span class="f">;</span>
<a name="1693" /><span class="Maybe">    1693:</span> 
<a name="1694" /><span class="Maybe">    1694:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">get_unmapped_area</span><span class="f">(</span><span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="f">;</span>
<a name="1695" /><span class="Maybe">    1695:</span> 
<a name="1696" /><span class="Maybe">    1696:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">mmap_region</span><span class="f">(</span><span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">file</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1697" /><span class="Maybe">    1697:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">len</span><span class="f">,</span> <span class="b">vm_flags_t</span> <span class="b">vm_flags</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">pgoff</span><span class="f">)</span><span class="f">;</span>
<a name="1698" /><span class="Maybe">    1698:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">do_mmap_pgoff</span><span class="f">(</span><span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">file</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1699" /><span class="Maybe">    1699:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">len</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">prot</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">flags</span><span class="f">,</span>
<a name="1700" /><span class="Maybe">    1700:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">pgoff</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">populate</span><span class="f">)</span><span class="f">;</span>
<a name="1701" /><span class="Maybe">    1701:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">do_munmap</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="b">size_t</span><span class="f">)</span><span class="f">;</span>
<a name="1702" /><span class="Maybe">    1702:</span> 
<a name="1703" /><span class="Maybe">    1703:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a>
<a name="1704" /><span class="Maybe">    1704:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">__mm_populate</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">len</span><span class="f">,</span>
<a name="1705" /><span class="Maybe">    1705:</span>              <span class="m">int</span> <span class="b">ignore_errors</span><span class="f">)</span><span class="f">;</span>
<a name="1706" /><span class="Maybe">    1706:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mm_populate</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">len</span><span class="f">)</span>
<a name="1707" /><span class="Maybe">    1707:</span> <span class="f">{</span>
<a name="1708" /><span class="Maybe">    1708:</span>     <span class="k">/* Ignore errors */</span>
<a name="1709" /><span class="Maybe">    1709:</span>     <span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">__mm_populate</span><span class="f">(</span><span class="b">addr</span><span class="f">,</span> <span class="b">len</span><span class="f">,</span> <span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="1710" /><span class="Maybe">    1710:</span> <span class="f">}</span>
<a name="1711" /><span class="False">    1711:</span> <span class="f">#</span><span class="n">else</span>
<a name="1712" /><span class="False">    1712:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mm_populate</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">len</span><span class="f">)</span> <span class="f">{</span><span class="f">}</span>
<a name="1713" /><span class="Maybe">    1713:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1714" /><span class="Maybe">    1714:</span> 
<a name="1715" /><span class="Maybe">    1715:</span> <span class="k">/* These take the mm semaphore themselves */</span>
<a name="1716" /><span class="Maybe">    1716:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">vm_brk</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="f">;</span>
<a name="1717" /><span class="Maybe">    1717:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">vm_munmap</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="b">size_t</span><span class="f">)</span><span class="f">;</span>
<a name="1718" /><span class="Maybe">    1718:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">vm_mmap</span><span class="f">(</span><span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span>
<a name="1719" /><span class="Maybe">    1719:</span>         <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span>
<a name="1720" /><span class="Maybe">    1720:</span>         <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="f">;</span>
<a name="1721" /><span class="Maybe">    1721:</span> 
<a name="1722" /><span class="Maybe">    1722:</span> <span class="m">struct</span> <span class="b">vm_unmapped_area_info</span> <span class="f">{</span>
<a name="1723" /><span class="Maybe">    1723:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Vk1fVU5NQVBQRURfQVJFQV9UT1BET1dOXzA_"><span class="b">VM_UNMAPPED_AREA_TOPDOWN</span></a> <span class="c">1</span>
<a name="1724" /><span class="Maybe">    1724:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">flags</span><span class="f">;</span>
<a name="1725" /><span class="Maybe">    1725:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">length</span><span class="f">;</span>
<a name="1726" /><span class="Maybe">    1726:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">low_limit</span><span class="f">;</span>
<a name="1727" /><span class="Maybe">    1727:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">high_limit</span><span class="f">;</span>
<a name="1728" /><span class="Maybe">    1728:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">align_mask</span><span class="f">;</span>
<a name="1729" /><span class="Maybe">    1729:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">align_offset</span><span class="f">;</span>
<a name="1730" /><span class="Maybe">    1730:</span> <span class="f">}</span><span class="f">;</span>
<a name="1731" /><span class="Maybe">    1731:</span> 
<a name="1732" /><span class="Maybe">    1732:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">unmapped_area</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_unmapped_area_info</span> <span class="f">*</span><span class="b">info</span><span class="f">)</span><span class="f">;</span>
<a name="1733" /><span class="Maybe">    1733:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">unmapped_area_topdown</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_unmapped_area_info</span> <span class="f">*</span><span class="b">info</span><span class="f">)</span><span class="f">;</span>
<a name="1734" /><span class="Maybe">    1734:</span> 
<a name="1735" /><span class="Maybe">    1735:</span> <span class="k">/*</span>
<a name="1736" /><span class="Maybe">    1736:</span> <span class="k"> * Search for an unmapped address range.</span>
<a name="1737" /><span class="Maybe">    1737:</span> <span class="k"> *</span>
<a name="1738" /><span class="Maybe">    1738:</span> <span class="k"> * We are looking for a range that:</span>
<a name="1739" /><span class="Maybe">    1739:</span> <span class="k"> * - does not intersect with any VMA;</span>
<a name="1740" /><span class="Maybe">    1740:</span> <span class="k"> * - is contained within the [low_limit, high_limit) interval;</span>
<a name="1741" /><span class="Maybe">    1741:</span> <span class="k"> * - is at least the desired size.</span>
<a name="1742" /><span class="Maybe">    1742:</span> <span class="k"> * - satisfies (begin_addr &amp; align_mask) == (align_offset &amp; align_mask)</span>
<a name="1743" /><span class="Maybe">    1743:</span> <span class="k"> */</span>
<a name="1744" /><span class="Maybe">    1744:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span>
<a name="1745" /><span class="Maybe">    1745:</span> <span class="b">vm_unmapped_area</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_unmapped_area_info</span> <span class="f">*</span><span class="b">info</span><span class="f">)</span>
<a name="1746" /><span class="Maybe">    1746:</span> <span class="f">{</span>
<a name="1747" /><span class="Maybe">    1747:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">!</span><span class="f">(</span><span class="b">info</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_Vk1fVU5NQVBQRURfQVJFQV9UT1BET1dOXzA_"><span class="b">VM_UNMAPPED_AREA_TOPDOWN</span></a><span class="f">)</span><span class="f">)</span>
<a name="1748" /><span class="Maybe">    1748:</span>         <span class="m">return</span> <span class="b">unmapped_area</span><span class="f">(</span><span class="b">info</span><span class="f">)</span><span class="f">;</span>
<a name="1749" /><span class="Maybe">    1749:</span>     <span class="m">else</span>
<a name="1750" /><span class="Maybe">    1750:</span>         <span class="m">return</span> <span class="b">unmapped_area_topdown</span><span class="f">(</span><span class="b">info</span><span class="f">)</span><span class="f">;</span>
<a name="1751" /><span class="Maybe">    1751:</span> <span class="f">}</span>
<a name="1752" /><span class="Maybe">    1752:</span> 
<a name="1753" /><span class="Maybe">    1753:</span> <span class="k">/* truncate.c */</span>
<a name="1754" /><span class="Maybe">    1754:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">truncate_inode_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="f">,</span> <span class="b">loff_t</span><span class="f">)</span><span class="f">;</span>
<a name="1755" /><span class="Maybe">    1755:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">truncate_inode_pages_range</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="f">,</span>
<a name="1756" /><span class="Maybe">    1756:</span>                        <span class="b">loff_t</span> <span class="b">lstart</span><span class="f">,</span> <span class="b">loff_t</span> <span class="b">lend</span><span class="f">)</span><span class="f">;</span>
<a name="1757" /><span class="Maybe">    1757:</span> 
<a name="1758" /><span class="Maybe">    1758:</span> <span class="k">/* generic vm_area_ops exported for stackable file systems */</span>
<a name="1759" /><span class="Maybe">    1759:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">filemap_fault</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_fault</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1760" /><span class="Maybe">    1760:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">filemap_page_mkwrite</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_fault</span> <span class="f">*</span><span class="b">vmf</span><span class="f">)</span><span class="f">;</span>
<a name="1761" /><span class="Maybe">    1761:</span> 
<a name="1762" /><span class="Maybe">    1762:</span> <span class="k">/* mm/page-writeback.c */</span>
<a name="1763" /><span class="Maybe">    1763:</span> <span class="m">int</span> <span class="b">write_one_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">wait</span><span class="f">)</span><span class="f">;</span>
<a name="1764" /><span class="Maybe">    1764:</span> <span class="m">void</span> <span class="b">task_dirty_inc</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">tsk</span><span class="f">)</span><span class="f">;</span>
<a name="1765" /><span class="Maybe">    1765:</span> 
<a name="1766" /><span class="Maybe">    1766:</span> <span class="k">/* readahead.c */</span>
<a name="1767" /><span class="Maybe">    1767:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTUFYX1JFQURBSEVBRF8w"><span class="b">VM_MAX_READAHEAD</span></a>    <span class="c">128</span>    <span class="k">/* kbytes */</span>
<a name="1768" /><span class="Maybe">    1768:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Vk1fTUlOX1JFQURBSEVBRF8w"><span class="b">VM_MIN_READAHEAD</span></a>    <span class="c">16</span>    <span class="k">/* kbytes (includes current page) */</span>
<a name="1769" /><span class="Maybe">    1769:</span> 
<a name="1770" /><span class="Maybe">    1770:</span> <span class="m">int</span> <span class="b">force_page_cache_readahead</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">,</span> <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">filp</span><span class="f">,</span>
<a name="1771" /><span class="Maybe">    1771:</span>             <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">offset</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr_to_read</span><span class="f">)</span><span class="f">;</span>
<a name="1772" /><span class="Maybe">    1772:</span> 
<a name="1773" /><span class="Maybe">    1773:</span> <span class="m">void</span> <span class="b">page_cache_sync_readahead</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">,</span>
<a name="1774" /><span class="Maybe">    1774:</span>                    <span class="m">struct</span> <span class="b">file_ra_state</span> <span class="f">*</span><span class="b">ra</span><span class="f">,</span>
<a name="1775" /><span class="Maybe">    1775:</span>                    <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">filp</span><span class="f">,</span>
<a name="1776" /><span class="Maybe">    1776:</span>                    <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">offset</span><span class="f">,</span>
<a name="1777" /><span class="Maybe">    1777:</span>                    <span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">)</span><span class="f">;</span>
<a name="1778" /><span class="Maybe">    1778:</span> 
<a name="1779" /><span class="Maybe">    1779:</span> <span class="m">void</span> <span class="b">page_cache_async_readahead</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">,</span>
<a name="1780" /><span class="Maybe">    1780:</span>                 <span class="m">struct</span> <span class="b">file_ra_state</span> <span class="f">*</span><span class="b">ra</span><span class="f">,</span>
<a name="1781" /><span class="Maybe">    1781:</span>                 <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">filp</span><span class="f">,</span>
<a name="1782" /><span class="Maybe">    1782:</span>                 <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">pg</span><span class="f">,</span>
<a name="1783" /><span class="Maybe">    1783:</span>                 <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">offset</span><span class="f">,</span>
<a name="1784" /><span class="Maybe">    1784:</span>                 <span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">)</span><span class="f">;</span>
<a name="1785" /><span class="Maybe">    1785:</span> 
<a name="1786" /><span class="Maybe">    1786:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">max_sane_readahead</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr</span><span class="f">)</span><span class="f">;</span>
<a name="1787" /><span class="Maybe">    1787:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">ra_submit</span><span class="f">(</span><span class="m">struct</span> <span class="b">file_ra_state</span> <span class="f">*</span><span class="b">ra</span><span class="f">,</span>
<a name="1788" /><span class="Maybe">    1788:</span>             <span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">,</span>
<a name="1789" /><span class="Maybe">    1789:</span>             <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">filp</span><span class="f">)</span><span class="f">;</span>
<a name="1790" /><span class="Maybe">    1790:</span> 
<a name="1791" /><span class="Maybe">    1791:</span> <span class="k">/* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */</span>
<a name="1792" /><span class="Maybe">    1792:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">expand_stack</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>
<a name="1793" /><span class="Maybe">    1793:</span> 
<a name="1794" /><span class="Maybe">    1794:</span> <span class="k">/* CONFIG_STACK_GROWSUP still needs to to grow downwards at some places */</span>
<a name="1795" /><span class="Maybe">    1795:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">expand_downwards</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1796" /><span class="Maybe">    1796:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>
<a name="1797" /><span class="False">    1797:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_Vk1fR1JPV1NVUF8w"><span class="b">VM_GROWSUP</span></a>
<a name="1798" /><span class="False">    1798:</span> <span class="m">extern</span> <span class="m">int</span> <a href="cpu.c_macros_noref.html#_ZXhwYW5kX3Vwd2FyZHNfMA__"><span class="b">expand_upwards</span></a><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">)</span><span class="f">;</span>
<a name="1799" /><span class="Maybe">    1799:</span> <span class="f">#</span><span class="n">else</span>
<a name="1800" /><span class="Maybe">    1800:</span>   <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZXhwYW5kX3Vwd2FyZHNfMA__"><span class="b">expand_upwards</span></a><span class="f">(</span><span class="b">vma</span><span class="f">,</span> <span class="b">address</span><span class="f">)</span> <span class="m">do</span> <span class="f">{</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="1801" /><span class="Maybe">    1801:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1802" /><span class="Maybe">    1802:</span> 
<a name="1803" /><span class="Maybe">    1803:</span> <span class="k">/* Look up the first VMA which satisfies  addr &lt; vm_end,  NULL if none. */</span>
<a name="1804" /><span class="Maybe">    1804:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span> <span class="b">find_vma</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span> <span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="1805" /><span class="Maybe">    1805:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span> <span class="b">find_vma_prev</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span> <span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1806" /><span class="Maybe">    1806:</span>                          <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">*</span><span class="b">pprev</span><span class="f">)</span><span class="f">;</span>
<a name="1807" /><span class="Maybe">    1807:</span> 
<a name="1808" /><span class="Maybe">    1808:</span> <span class="k">/* Look up the first VMA which intersects the interval start_addr..end_addr-1,</span>
<a name="1809" /><span class="Maybe">    1809:</span> <span class="k">   NULL if none.  Assume start_addr &lt; end_addr. */</span>
<a name="1810" /><span class="Maybe">    1810:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span> <span class="b">find_vma_intersection</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span> <span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start_addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end_addr</span><span class="f">)</span>
<a name="1811" /><span class="Maybe">    1811:</span> <span class="f">{</span>
<a name="1812" /><span class="Maybe">    1812:</span>     <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span> <span class="b">vma</span> <span class="f">=</span> <span class="b">find_vma</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span><span class="b">start_addr</span><span class="f">)</span><span class="f">;</span>
<a name="1813" /><span class="Maybe">    1813:</span> 
<a name="1814" /><span class="Maybe">    1814:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">vma</span> <span class="f">&amp;&amp;</span> <span class="b">end_addr</span> <span class="f">&lt;=</span> <span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_start</span><span class="f">)</span>
<a name="1815" /><span class="Maybe">    1815:</span>         <span class="b">vma</span> <span class="f">=</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="1816" /><span class="Maybe">    1816:</span>     <span class="m">return</span> <span class="b">vma</span><span class="f">;</span>
<a name="1817" /><span class="Maybe">    1817:</span> <span class="f">}</span>
<a name="1818" /><span class="Maybe">    1818:</span> 
<a name="1819" /><span class="Maybe">    1819:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">vma_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">)</span>
<a name="1820" /><span class="Maybe">    1820:</span> <span class="f">{</span>
<a name="1821" /><span class="Maybe">    1821:</span>     <span class="m">return</span> <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_end</span> <span class="f">-</span> <span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_start</span><span class="f">)</span> <span class="f">&gt;&gt;</span> <a href="cpu.c_macros_ref.html#_UEFHRV9TSElGVF8w"><span class="b">PAGE_SHIFT</span></a><span class="f">;</span>
<a name="1822" /><span class="Maybe">    1822:</span> <span class="f">}</span>
<a name="1823" /><span class="Maybe">    1823:</span> 
<a name="1824" /><span class="Maybe">    1824:</span> <span class="k">/* Look up the first VMA which exactly match the interval vm_start ... vm_end */</span>
<a name="1825" /><span class="Maybe">    1825:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">find_exact_vma</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="1826" /><span class="Maybe">    1826:</span>                 <span class="m">unsigned</span> <span class="m">long</span> <span class="b">vm_start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">vm_end</span><span class="f">)</span>
<a name="1827" /><span class="Maybe">    1827:</span> <span class="f">{</span>
<a name="1828" /><span class="Maybe">    1828:</span>     <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span> <span class="f">=</span> <span class="b">find_vma</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">vm_start</span><span class="f">)</span><span class="f">;</span>
<a name="1829" /><span class="Maybe">    1829:</span> 
<a name="1830" /><span class="Maybe">    1830:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">vma</span> <span class="f">&amp;&amp;</span> <span class="f">(</span><span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_start</span> <span class="f">!=</span> <span class="b">vm_start</span> <span class="f">||</span> <span class="b">vma</span><span class="f">-&gt;</span><span class="b">vm_end</span> <span class="f">!=</span> <span class="b">vm_end</span><span class="f">)</span><span class="f">)</span>
<a name="1831" /><span class="Maybe">    1831:</span>         <span class="b">vma</span> <span class="f">=</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="1832" /><span class="Maybe">    1832:</span> 
<a name="1833" /><span class="Maybe">    1833:</span>     <span class="m">return</span> <span class="b">vma</span><span class="f">;</span>
<a name="1834" /><span class="Maybe">    1834:</span> <span class="f">}</span>
<a name="1835" /><span class="Maybe">    1835:</span> 
<a name="1836" /><span class="Maybe">    1836:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a>
<a name="1837" /><span class="Maybe">    1837:</span> <span class="b">pgprot_t</span> <span class="b">vm_get_page_prot</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">vm_flags</span><span class="f">)</span><span class="f">;</span>
<a name="1838" /><span class="False">    1838:</span> <span class="f">#</span><span class="n">else</span>
<a name="1839" /><span class="False">    1839:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">pgprot_t</span> <span class="b">vm_get_page_prot</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">vm_flags</span><span class="f">)</span>
<a name="1840" /><span class="False">    1840:</span> <span class="f">{</span>
<a name="1841" /><span class="False">    1841:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_X19wZ3Byb3RfMA__"><span class="b">__pgprot</span></a><span class="f">(</span><span class="c">0</span><span class="f">)</span><span class="f">;</span>
<a name="1842" /><span class="False">    1842:</span> <span class="f">}</span>
<a name="1843" /><span class="Maybe">    1843:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1844" /><span class="Maybe">    1844:</span> 
<a name="1845" /><span class="False">    1845:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_ARCH_USES_NUMA_PROT_NONE</span>
<a name="1846" /><span class="False">    1846:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">change_prot_numa</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1847" /><span class="False">    1847:</span>             <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">)</span><span class="f">;</span>
<a name="1848" /><span class="Maybe">    1848:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1849" /><span class="Maybe">    1849:</span> 
<a name="1850" /><span class="Maybe">    1850:</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">find_extend_vma</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="1851" /><span class="Maybe">    1851:</span> <span class="m">int</span> <span class="b">remap_pfn_range</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1852" /><span class="Maybe">    1852:</span>             <span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">,</span> <span class="b">pgprot_t</span><span class="f">)</span><span class="f">;</span>
<a name="1853" /><span class="Maybe">    1853:</span> <span class="m">int</span> <span class="b">vm_insert_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1854" /><span class="Maybe">    1854:</span> <span class="m">int</span> <span class="b">vm_insert_pfn</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1855" /><span class="Maybe">    1855:</span>             <span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1856" /><span class="Maybe">    1856:</span> <span class="m">int</span> <span class="b">vm_insert_mixed</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1857" /><span class="Maybe">    1857:</span>             <span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1858" /><span class="Maybe">    1858:</span> <span class="m">int</span> <span class="b">vm_iomap_memory</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="b">phys_addr_t</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">len</span><span class="f">)</span><span class="f">;</span>
<a name="1859" /><span class="Maybe">    1859:</span> 
<a name="1860" /><span class="Maybe">    1860:</span> 
<a name="1861" /><span class="Maybe">    1861:</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">follow_page_mask</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1862" /><span class="Maybe">    1862:</span>                   <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">foll_flags</span><span class="f">,</span>
<a name="1863" /><span class="Maybe">    1863:</span>                   <span class="m">unsigned</span> <span class="m">int</span> <span class="f">*</span><span class="b">page_mask</span><span class="f">)</span><span class="f">;</span>
<a name="1864" /><span class="Maybe">    1864:</span> 
<a name="1865" /><span class="Maybe">    1865:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">follow_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1866" /><span class="Maybe">    1866:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">foll_flags</span><span class="f">)</span>
<a name="1867" /><span class="Maybe">    1867:</span> <span class="f">{</span>
<a name="1868" /><span class="Maybe">    1868:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">unused_page_mask</span><span class="f">;</span>
<a name="1869" /><span class="Maybe">    1869:</span>     <span class="m">return</span> <span class="b">follow_page_mask</span><span class="f">(</span><span class="b">vma</span><span class="f">,</span> <span class="b">address</span><span class="f">,</span> <span class="b">foll_flags</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">unused_page_mask</span><span class="f">)</span><span class="f">;</span>
<a name="1870" /><span class="Maybe">    1870:</span> <span class="f">}</span>
<a name="1871" /><span class="Maybe">    1871:</span> 
<a name="1872" /><span class="Maybe">    1872:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9XUklURV8w"><span class="b">FOLL_WRITE</span></a>    <span class="c">0x01</span>    <span class="k">/* check pte is writable */</span>
<a name="1873" /><span class="Maybe">    1873:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9UT1VDSF8w"><span class="b">FOLL_TOUCH</span></a>    <span class="c">0x02</span>    <span class="k">/* mark page accessed */</span>
<a name="1874" /><span class="Maybe">    1874:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9HRVRfMA__"><span class="b">FOLL_GET</span></a>    <span class="c">0x04</span>    <span class="k">/* do get_page on page */</span>
<a name="1875" /><span class="Maybe">    1875:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9EVU1QXzA_"><span class="b">FOLL_DUMP</span></a>    <span class="c">0x08</span>    <span class="k">/* give error on hole if it would be zero */</span>
<a name="1876" /><span class="Maybe">    1876:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9GT1JDRV8w"><span class="b">FOLL_FORCE</span></a>    <span class="c">0x10</span>    <span class="k">/* get_user_pages read/write w/o permission */</span>
<a name="1877" /><span class="Maybe">    1877:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9OT1dBSVRfMA__"><span class="b">FOLL_NOWAIT</span></a>    <span class="c">0x20</span>    <span class="k">/* if a disk transfer is needed, start the IO</span>
<a name="1878" /><span class="Maybe">    1878:</span> <span class="k">                 * and return without waiting upon it */</span>
<a name="1879" /><span class="Maybe">    1879:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9NTE9DS18w"><span class="b">FOLL_MLOCK</span></a>    <span class="c">0x40</span>    <span class="k">/* mark page as mlocked */</span>
<a name="1880" /><span class="Maybe">    1880:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9TUExJVF8w"><span class="b">FOLL_SPLIT</span></a>    <span class="c">0x80</span>    <span class="k">/* don&apos;t return transhuge pages, split them */</span>
<a name="1881" /><span class="Maybe">    1881:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9IV1BPSVNPTl8w"><span class="b">FOLL_HWPOISON</span></a>    <span class="c">0x100</span>    <span class="k">/* check page is hwpoisoned */</span>
<a name="1882" /><span class="Maybe">    1882:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9OVU1BXzA_"><span class="b">FOLL_NUMA</span></a>    <span class="c">0x200</span>    <span class="k">/* force NUMA hinting page fault */</span>
<a name="1883" /><span class="Maybe">    1883:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Rk9MTF9NSUdSQVRJT05fMA__"><span class="b">FOLL_MIGRATION</span></a>    <span class="c">0x400</span>    <span class="k">/* wait for page to replace migration entry */</span>
<a name="1884" /><span class="Maybe">    1884:</span> 
<a name="1885" /><span class="Maybe">    1885:</span> <span class="m">typedef</span> <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">pte_fn_t</span><span class="f">)</span><span class="f">(</span><span class="b">pte_t</span> <span class="f">*</span><span class="b">pte</span><span class="f">,</span> <span class="b">pgtable_t</span> <span class="b">token</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1886" /><span class="Maybe">    1886:</span>             <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">;</span>
<a name="1887" /><span class="Maybe">    1887:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">apply_to_page_range</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">address</span><span class="f">,</span>
<a name="1888" /><span class="Maybe">    1888:</span>                    <span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">,</span> <span class="b">pte_fn_t</span> <span class="b">fn</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">data</span><span class="f">)</span><span class="f">;</span>
<a name="1889" /><span class="Maybe">    1889:</span> 
<a name="1890" /><span class="Maybe">    1890:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX1BST0NfRlNfMA__"><span class="b">CONFIG_PROC_FS</span></a>
<a name="1891" /><span class="Maybe">    1891:</span> <span class="m">void</span> <span class="b">vm_stat_account</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="f">,</span> <span class="m">long</span><span class="f">)</span><span class="f">;</span>
<a name="1892" /><span class="False">    1892:</span> <span class="f">#</span><span class="n">else</span>
<a name="1893" /><span class="False">    1893:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">vm_stat_account</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="1894" /><span class="False">    1894:</span>             <span class="m">unsigned</span> <span class="m">long</span> <span class="b">flags</span><span class="f">,</span> <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">file</span><span class="f">,</span> <span class="m">long</span> <span class="b">pages</span><span class="f">)</span>
<a name="1895" /><span class="False">    1895:</span> <span class="f">{</span>
<a name="1896" /><span class="False">    1896:</span>     <span class="b">mm</span><span class="f">-&gt;</span><span class="b">total_vm</span> <span class="f">+=</span> <span class="b">pages</span><span class="f">;</span>
<a name="1897" /><span class="False">    1897:</span> <span class="f">}</span>
<a name="1898" /><span class="Maybe">    1898:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_PROC_FS */</span>
<a name="1899" /><span class="Maybe">    1899:</span> 
<a name="1900" /><span class="False">    1900:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_DEBUG_PAGEALLOC</span>
<a name="1901" /><span class="False">    1901:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">kernel_map_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">numpages</span><span class="f">,</span> <span class="m">int</span> <span class="b">enable</span><span class="f">)</span><span class="f">;</span>
<a name="1902" /><span class="False">    1902:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX0hJQkVSTkFUSU9OXzA_"><span class="b">CONFIG_HIBERNATION</span></a>
<a name="1903" /><span class="False">    1903:</span> <span class="m">extern</span> <span class="m">bool</span> <span class="b">kernel_page_present</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1904" /><span class="False">    1904:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_HIBERNATION */</span>
<a name="1905" /><span class="Maybe">    1905:</span> <span class="f">#</span><span class="n">else</span>
<a name="1906" /><span class="Maybe">    1906:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="1907" /><span class="Maybe">    1907:</span> <span class="b">kernel_map_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">numpages</span><span class="f">,</span> <span class="m">int</span> <span class="b">enable</span><span class="f">)</span> <span class="f">{</span><span class="f">}</span>
<a name="1908" /><span class="Maybe">    1908:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX0hJQkVSTkFUSU9OXzA_"><span class="b">CONFIG_HIBERNATION</span></a>
<a name="1909" /><span class="Maybe">    1909:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">kernel_page_present</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span> <span class="f">{</span> <span class="m">return</span> <span class="m">true</span><span class="f">;</span> <span class="f">}</span>
<a name="1910" /><span class="Maybe">    1910:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_HIBERNATION */</span>
<a name="1911" /><span class="Maybe">    1911:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1912" /><span class="Maybe">    1912:</span> 
<a name="1913" /><span class="Maybe">    1913:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">get_gate_vma</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span><span class="f">;</span>
<a name="1914" /><span class="Maybe">    1914:</span> <span class="f">#</span><span class="n">ifdef</span>    <a href="cpu.c_macros_ref.html#_X19IQVZFX0FSQ0hfR0FURV9BUkVBXzA_"><span class="b">__HAVE_ARCH_GATE_AREA</span></a>
<a name="1915" /><span class="Maybe">    1915:</span> <span class="m">int</span> <span class="b">in_gate_area_no_mm</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="1916" /><span class="Maybe">    1916:</span> <span class="m">int</span> <span class="b">in_gate_area</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="1917" /><span class="False">    1917:</span> <span class="f">#</span><span class="n">else</span>
<a name="1918" /><span class="False">    1918:</span> <span class="m">int</span> <span class="b">in_gate_area_no_mm</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="1919" /><span class="False">    1919:</span> <span class="f">#</span><span class="n">define</span> <span class="b">in_gate_area</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">addr</span><span class="f">)</span> <span class="f">(</span><span class="f">{</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="b">mm</span><span class="f">;</span> <span class="b">in_gate_area_no_mm</span><span class="f">(</span><span class="b">addr</span><span class="f">)</span><span class="f">;</span><span class="f">}</span><span class="f">)</span>
<a name="1920" /><span class="Maybe">    1920:</span> <span class="f">#</span><span class="n">endif</span>    <span class="k">/* __HAVE_ARCH_GATE_AREA */</span>
<a name="1921" /><span class="Maybe">    1921:</span> 
<a name="1922" /><span class="Maybe">    1922:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX1NZU0NUTF8w"><span class="b">CONFIG_SYSCTL</span></a>
<a name="1923" /><span class="Maybe">    1923:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">sysctl_drop_caches</span><span class="f">;</span>
<a name="1924" /><span class="Maybe">    1924:</span> <span class="m">int</span> <span class="b">drop_caches_sysctl_handler</span><span class="f">(</span><span class="m">struct</span> <span class="b">ctl_table</span> <span class="f">*</span><span class="f">,</span> <span class="m">int</span><span class="f">,</span>
<a name="1925" /><span class="Maybe">    1925:</span>                     <span class="m">void</span> <a href="cpu.c_macros_ref.html#_X191c2VyXzA_"><span class="b">__user</span></a> <span class="f">*</span><span class="f">,</span> <span class="b">size_t</span> <span class="f">*</span><span class="f">,</span> <span class="b">loff_t</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="1926" /><span class="Maybe">    1926:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1927" /><span class="Maybe">    1927:</span> 
<a name="1928" /><span class="Maybe">    1928:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">shrink_slab</span><span class="f">(</span><span class="m">struct</span> <span class="b">shrink_control</span> <span class="f">*</span><span class="b">shrink</span><span class="f">,</span>
<a name="1929" /><span class="Maybe">    1929:</span>               <span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr_pages_scanned</span><span class="f">,</span>
<a name="1930" /><span class="Maybe">    1930:</span>               <span class="m">unsigned</span> <span class="m">long</span> <span class="b">lru_pages</span><span class="f">)</span><span class="f">;</span>
<a name="1931" /><span class="Maybe">    1931:</span> 
<a name="1932" /><span class="False">    1932:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01NVV8w"><span class="b">CONFIG_MMU</span></a>
<a name="1933" /><span class="False">    1933:</span> <span class="f">#</span><span class="n">define</span> <span class="b">randomize_va_space</span> <span class="c">0</span>
<a name="1934" /><span class="Maybe">    1934:</span> <span class="f">#</span><span class="n">else</span>
<a name="1935" /><span class="Maybe">    1935:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">randomize_va_space</span><span class="f">;</span>
<a name="1936" /><span class="Maybe">    1936:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1937" /><span class="Maybe">    1937:</span> 
<a name="1938" /><span class="Maybe">    1938:</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span> <span class="b">arch_vma_name</span><span class="f">(</span><span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">)</span><span class="f">;</span>
<a name="1939" /><span class="Maybe">    1939:</span> <span class="m">void</span> <span class="b">print_vma_addr</span><span class="f">(</span><span class="m">char</span> <span class="f">*</span><span class="b">prefix</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">rip</span><span class="f">)</span><span class="f">;</span>
<a name="1940" /><span class="Maybe">    1940:</span> 
<a name="1941" /><span class="Maybe">    1941:</span> <span class="m">void</span> <span class="b">sparse_mem_maps_populate_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="b">map_map</span><span class="f">,</span>
<a name="1942" /><span class="Maybe">    1942:</span>                    <span class="m">unsigned</span> <span class="m">long</span> <span class="b">pnum_begin</span><span class="f">,</span>
<a name="1943" /><span class="Maybe">    1943:</span>                    <span class="m">unsigned</span> <span class="m">long</span> <span class="b">pnum_end</span><span class="f">,</span>
<a name="1944" /><span class="Maybe">    1944:</span>                    <span class="m">unsigned</span> <span class="m">long</span> <span class="b">map_count</span><span class="f">,</span>
<a name="1945" /><span class="Maybe">    1945:</span>                    <span class="m">int</span> <span class="b">nodeid</span><span class="f">)</span><span class="f">;</span>
<a name="1946" /><span class="Maybe">    1946:</span> 
<a name="1947" /><span class="Maybe">    1947:</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">sparse_mem_map_populate</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">pnum</span><span class="f">,</span> <span class="m">int</span> <span class="b">nid</span><span class="f">)</span><span class="f">;</span>
<a name="1948" /><span class="Maybe">    1948:</span> <span class="b">pgd_t</span> <span class="f">*</span><span class="b">vmemmap_pgd_populate</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">int</span> <span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="1949" /><span class="Maybe">    1949:</span> <span class="b">pud_t</span> <span class="f">*</span><span class="b">vmemmap_pud_populate</span><span class="f">(</span><span class="b">pgd_t</span> <span class="f">*</span><span class="b">pgd</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">int</span> <span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="1950" /><span class="Maybe">    1950:</span> <span class="b">pmd_t</span> <span class="f">*</span><span class="b">vmemmap_pmd_populate</span><span class="f">(</span><span class="b">pud_t</span> <span class="f">*</span><span class="b">pud</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">int</span> <span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="1951" /><span class="Maybe">    1951:</span> <span class="b">pte_t</span> <span class="f">*</span><span class="b">vmemmap_pte_populate</span><span class="f">(</span><span class="b">pmd_t</span> <span class="f">*</span><span class="b">pmd</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">int</span> <span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="1952" /><span class="Maybe">    1952:</span> <span class="m">void</span> <span class="f">*</span><span class="b">vmemmap_alloc_block</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">,</span> <span class="m">int</span> <span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="1953" /><span class="Maybe">    1953:</span> <span class="m">void</span> <span class="f">*</span><span class="b">vmemmap_alloc_block_buf</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">,</span> <span class="m">int</span> <span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="1954" /><span class="Maybe">    1954:</span> <span class="m">void</span> <span class="b">vmemmap_verify</span><span class="f">(</span><span class="b">pte_t</span> <span class="f">*</span><span class="f">,</span> <span class="m">int</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="f">;</span>
<a name="1955" /><span class="Maybe">    1955:</span> <span class="m">int</span> <span class="b">vmemmap_populate_basepages</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">,</span>
<a name="1956" /><span class="Maybe">    1956:</span>                    <span class="m">int</span> <span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="1957" /><span class="Maybe">    1957:</span> <span class="m">int</span> <span class="b">vmemmap_populate</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">,</span> <span class="m">int</span> <span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="1958" /><span class="Maybe">    1958:</span> <span class="m">void</span> <span class="b">vmemmap_populate_print_last</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="1959" /><span class="False">    1959:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_MEMORY_HOTPLUG</span>
<a name="1960" /><span class="False">    1960:</span> <span class="m">void</span> <span class="b">vmemmap_free</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">start</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">end</span><span class="f">)</span><span class="f">;</span>
<a name="1961" /><span class="Maybe">    1961:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1962" /><span class="Maybe">    1962:</span> <span class="m">void</span> <span class="b">register_page_bootmem_memmap</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">section_nr</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">map</span><span class="f">,</span>
<a name="1963" /><span class="Maybe">    1963:</span>                   <span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">)</span><span class="f">;</span>
<a name="1964" /><span class="Maybe">    1964:</span> 
<a name="1965" /><span class="Maybe">    1965:</span> <span class="m">enum</span> <span class="b">mf_flags</span> <span class="f">{</span>
<a name="1966" /><span class="Maybe">    1966:</span>     <span class="b">MF_COUNT_INCREASED</span> <span class="f">=</span> <span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">0</span><span class="f">,</span>
<a name="1967" /><span class="Maybe">    1967:</span>     <span class="b">MF_ACTION_REQUIRED</span> <span class="f">=</span> <span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">1</span><span class="f">,</span>
<a name="1968" /><span class="Maybe">    1968:</span>     <span class="b">MF_MUST_KILL</span> <span class="f">=</span> <span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">2</span><span class="f">,</span>
<a name="1969" /><span class="Maybe">    1969:</span>     <span class="b">MF_SOFT_OFFLINE</span> <span class="f">=</span> <span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">3</span><span class="f">,</span>
<a name="1970" /><span class="Maybe">    1970:</span> <span class="f">}</span><span class="f">;</span>
<a name="1971" /><span class="Maybe">    1971:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">memory_failure</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">,</span> <span class="m">int</span> <span class="b">trapno</span><span class="f">,</span> <span class="m">int</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="1972" /><span class="Maybe">    1972:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">memory_failure_queue</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">,</span> <span class="m">int</span> <span class="b">trapno</span><span class="f">,</span> <span class="m">int</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="1973" /><span class="Maybe">    1973:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">unpoison_memory</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">pfn</span><span class="f">)</span><span class="f">;</span>
<a name="1974" /><span class="Maybe">    1974:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">sysctl_memory_failure_early_kill</span><span class="f">;</span>
<a name="1975" /><span class="Maybe">    1975:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">sysctl_memory_failure_recovery</span><span class="f">;</span>
<a name="1976" /><span class="Maybe">    1976:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">shake_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">p</span><span class="f">,</span> <span class="m">int</span> <span class="b">access</span><span class="f">)</span><span class="f">;</span>
<a name="1977" /><span class="Maybe">    1977:</span> <span class="m">extern</span> <span class="b">atomic_long_t</span> <span class="b">num_poisoned_pages</span><span class="f">;</span>
<a name="1978" /><span class="Maybe">    1978:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">soft_offline_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="1979" /><span class="Maybe">    1979:</span> 
<a name="1980" /><span class="Maybe">    1980:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">dump_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="1981" /><span class="Maybe">    1981:</span> 
<a name="1982" /><span class="Maybe">    1982:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_TRANSPARENT_HUGEPAGE</span><span class="f">)</span> <span class="f">||</span> <span class="b">defined</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX0hVR0VUTEJGU18w"><span class="b">CONFIG_HUGETLBFS</span></a><span class="f">)</span>
<a name="1983" /><span class="Maybe">    1983:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">clear_huge_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="1984" /><span class="Maybe">    1984:</span>                 <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span>
<a name="1985" /><span class="Maybe">    1985:</span>                 <span class="m">unsigned</span> <span class="m">int</span> <span class="b">pages_per_huge_page</span><span class="f">)</span><span class="f">;</span>
<a name="1986" /><span class="Maybe">    1986:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">copy_user_huge_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">dst</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">src</span><span class="f">,</span>
<a name="1987" /><span class="Maybe">    1987:</span>                 <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">,</span> <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span>
<a name="1988" /><span class="Maybe">    1988:</span>                 <span class="m">unsigned</span> <span class="m">int</span> <span class="b">pages_per_huge_page</span><span class="f">)</span><span class="f">;</span>
<a name="1989" /><span class="Maybe">    1989:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */</span>
<a name="1990" /><span class="Maybe">    1990:</span> 
<a name="1991" /><span class="False">    1991:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_DEBUG_PAGEALLOC</span>
<a name="1992" /><span class="False">    1992:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">_debug_guardpage_minorder</span><span class="f">;</span>
<a name="1993" /><span class="False">    1993:</span> 
<a name="1994" /><span class="False">    1994:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">debug_guardpage_minorder</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="1995" /><span class="False">    1995:</span> <span class="f">{</span>
<a name="1996" /><span class="False">    1996:</span>     <span class="m">return</span> <span class="b">_debug_guardpage_minorder</span><span class="f">;</span>
<a name="1997" /><span class="False">    1997:</span> <span class="f">}</span>
<a name="1998" /><span class="False">    1998:</span> 
<a name="1999" /><span class="False">    1999:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">page_is_guard</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="2000" /><span class="False">    2000:</span> <span class="f">{</span>
<a name="2001" /><span class="False">    2001:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_dGVzdF9iaXRfMA__"><span class="b">test_bit</span></a><span class="f">(</span><span class="b">PAGE_DEBUG_FLAG_GUARD</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">page</span><span class="f">-&gt;</span><span class="b">debug_flags</span><span class="f">)</span><span class="f">;</span>
<a name="2002" /><span class="False">    2002:</span> <span class="f">}</span>
<a name="2003" /><span class="Maybe">    2003:</span> <span class="f">#</span><span class="n">else</span>
<a name="2004" /><span class="Maybe">    2004:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">debug_guardpage_minorder</span><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="f">{</span> <span class="m">return</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span>
<a name="2005" /><span class="Maybe">    2005:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">page_is_guard</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span> <span class="f">{</span> <span class="m">return</span> <span class="m">false</span><span class="f">;</span> <span class="f">}</span>
<a name="2006" /><span class="Maybe">    2006:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_DEBUG_PAGEALLOC */</span>
<a name="2007" /><span class="Maybe">    2007:</span> 
<a name="2008" /><span class="Maybe">    2008:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_TUFYX05VTU5PREVTXzA_"><span class="b">MAX_NUMNODES</span></a> <span class="f">&gt;</span> <span class="c">1</span>
<a name="2009" /><span class="Maybe">    2009:</span> <span class="m">void</span> <a href="cpu.c_macros_ref.html#_X19pbml0XzA_"><span class="b">__init</span></a> <span class="b">setup_nr_node_ids</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="2010" /><span class="False">    2010:</span> <span class="f">#</span><span class="n">else</span>
<a name="2011" /><span class="False">    2011:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">setup_nr_node_ids</span><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="f">{</span><span class="f">}</span>
<a name="2012" /><span class="Maybe">    2012:</span> <span class="f">#</span><span class="n">endif</span>
<a name="2013" /><span class="Maybe">    2013:</span> 
<a name="2014" /><span class="Maybe">    2014:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* __KERNEL__ */</span>
<a name="2015" /><span class="True">    2015:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* _LINUX_MM_H */</span>
<a name="2016" /><span class="True">    2016:</span> </pre>
  </body>
</html>
